diff options
Diffstat (limited to 'vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go')
| -rw-r--r-- | vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go | 30157 |
1 files changed, 17118 insertions, 13039 deletions
diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go index aff0845d7..359240b10 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go @@ -332,6 +332,7 @@ const EP_Skip = 8192 const EP_Static = 134217728 const EP_Subquery = 4194304 const EP_Subrtn = 33554432 +const EP_SubtArg = 2147483648 const EP_TokenOnly = 65536 const EP_Unlikely = 524288 const EP_VarSelect = 64 @@ -441,6 +442,7 @@ const FTS5_COMMA = 13 const FTS5_CONTENT_EXTERNAL = 2 const FTS5_CONTENT_NONE = 1 const FTS5_CONTENT_NORMAL = 0 +const FTS5_CONTENT_UNINDEXED = 3 const FTS5_CORRUPT = 267 const FTS5_CURRENT_VERSION = 4 const FTS5_CURRENT_VERSION_SECUREDELETE = 5 @@ -462,6 +464,7 @@ const FTS5_DETAIL_COLUMNS = 2 const FTS5_DETAIL_FULL = 0 const FTS5_DETAIL_NONE = 1 const FTS5_EOF = 0 +const FTS5_INSTTOKEN_SUBTYPE = 73 const FTS5_LCP = 7 const FTS5_LP = 10 const FTS5_MAIN_PREFIX = 48 @@ -498,15 +501,16 @@ const FTS5_RP = 11 const FTS5_SEGITER_ONETERM = 1 const FTS5_SEGITER_REVERSE = 2 const FTS5_STAR = 15 -const FTS5_STMT_DELETE_CONTENT = 5 -const FTS5_STMT_DELETE_DOCSIZE = 7 -const FTS5_STMT_INSERT_CONTENT = 3 +const FTS5_STMT_DELETE_CONTENT = 6 +const FTS5_STMT_DELETE_DOCSIZE = 8 +const FTS5_STMT_INSERT_CONTENT = 4 const FTS5_STMT_LOOKUP = 2 -const FTS5_STMT_LOOKUP_DOCSIZE = 8 -const FTS5_STMT_REPLACE_CONFIG = 9 -const FTS5_STMT_REPLACE_CONTENT = 4 -const FTS5_STMT_REPLACE_DOCSIZE = 6 -const FTS5_STMT_SCAN = 10 +const FTS5_STMT_LOOKUP2 = 3 +const FTS5_STMT_LOOKUP_DOCSIZE = 9 +const FTS5_STMT_REPLACE_CONFIG = 10 +const FTS5_STMT_REPLACE_CONTENT = 5 +const FTS5_STMT_REPLACE_DOCSIZE = 7 +const FTS5_STMT_SCAN = 11 const FTS5_STMT_SCAN_ASC = 0 const FTS5_STMT_SCAN_DESC = 1 const FTS5_STRING = 9 @@ -519,14 +523,15 @@ const FTS5_TOKENIZE_PREFIX = 2 const FTS5_TOKENIZE_QUERY = 1 const FTS5_TOKEN_COLOCATED = 1 const FTS5_VOCAB_COL = 0 +const FTS5_VOCAB_COLUSED_MASK = 255 const FTS5_VOCAB_COL_SCHEMA = "term, col, doc, cnt" const FTS5_VOCAB_INSTANCE = 2 const FTS5_VOCAB_INST_SCHEMA = "term, doc, col, offset" const FTS5_VOCAB_ROW = 1 const FTS5_VOCAB_ROW_SCHEMA = "term, doc, cnt" -const FTS5_VOCAB_TERM_EQ = 1 -const FTS5_VOCAB_TERM_GE = 2 -const FTS5_VOCAB_TERM_LE = 4 +const FTS5_VOCAB_TERM_EQ = 256 +const FTS5_VOCAB_TERM_GE = 512 +const FTS5_VOCAB_TERM_LE = 1024 const FTS5_WORK_UNIT = 64 const FULLY_WITHIN = 2 const FUNC_PERFECT_MATCH = 6 @@ -588,6 +593,7 @@ const HASHTABLE_HASH_1 = 383 const HASHTABLE_NPAGE = 4096 const HASHTABLE_NPAGE_ONE = 4096 const HASHTABLE_NSLOT = 8192 +const HAVE_FCHMOD = 1 const HAVE_FCHOWN = 1 const HAVE_FULLFSYNC = 0 const HAVE_GETHOSTUUID = 0 @@ -692,6 +698,8 @@ const LEGACY_TEMP_SCHEMA_TABLE = "sqlite_temp_master" const LITTLE_ENDIAN = 1234 const LOCATE_NOERR = 2 const LOCATE_VIEW = 1 +const LOGEST_MAX = 32767 +const LOGEST_MIN = -32768 const LONGDOUBLE_TYPE = 0 const LOOKASIDE_SMALL = 128 const L_INCR = 1 @@ -818,7 +826,6 @@ const NAN = 0 const NB = 3 const NC_AllowAgg = 1 const NC_AllowWin = 16384 -const NC_Complex = 8192 const NC_FromDDL = 262144 const NC_GenCol = 8 const NC_HasAgg = 16 @@ -918,7 +925,7 @@ const OPFLG_NCYCLE = 64 const OPFLG_OUT2 = 16 const OPFLG_OUT3 = 32 const OP_Abortable = 189 -const OP_Add = 106 +const OP_Add = 107 const OP_AddImm = 86 const OP_Affinity = 96 const OP_AggFinal = 165 @@ -929,9 +936,9 @@ const OP_AggValue = 164 const OP_And = 44 const OP_AutoCommit = 1 const OP_BeginSubrtn = 74 -const OP_BitAnd = 102 -const OP_BitNot = 114 -const OP_BitOr = 103 +const OP_BitAnd = 103 +const OP_BitNot = 115 +const OP_BitOr = 104 const OP_Blob = 77 const OP_Cast = 88 const OP_Checkpoint = 3 @@ -942,7 +949,7 @@ const OP_CollSeq = 85 const OP_Column = 94 const OP_ColumnsUsed = 123 const OP_Compare = 90 -const OP_Concat = 111 +const OP_Concat = 112 const OP_Copy = 80 const OP_Count = 98 const OP_CreateBtree = 147 @@ -953,13 +960,13 @@ const OP_DecrJumpZero = 61 const OP_DeferredSeek = 141 const OP_Delete = 130 const OP_Destroy = 144 -const OP_Divide = 109 +const OP_Divide = 110 const OP_DropIndex = 152 const OP_DropTable = 151 -const OP_DropTrigger = 154 -const OP_ElseEq = 58 +const OP_DropTrigger = 153 +const OP_ElseEq = 59 const OP_EndCoroutine = 68 -const OP_Eq = 53 +const OP_Eq = 54 const OP_Expire = 166 const OP_Explain = 188 const OP_Filter = 64 @@ -970,11 +977,11 @@ const OP_FkCounter = 158 const OP_FkIfZero = 49 const OP_Found = 29 const OP_Function = 66 -const OP_Ge = 57 +const OP_Ge = 58 const OP_GetSubtype = 181 const OP_Gosub = 10 const OP_Goto = 9 -const OP_Gt = 54 +const OP_Gt = 55 const OP_Halt = 70 const OP_HaltIfNull = 69 const OP_IdxDelete = 140 @@ -990,7 +997,7 @@ const OP_IfNot = 17 const OP_IfNotOpen = 25 const OP_IfNotZero = 60 const OP_IfNullRow = 20 -const OP_IfPos = 59 +const OP_IfPos = 50 const OP_IfSizeBetween = 33 const OP_IncrVacuum = 62 const OP_Init = 8 @@ -1000,22 +1007,22 @@ const OP_Int64 = 72 const OP_IntCopy = 82 const OP_Integer = 71 const OP_IntegrityCk = 155 -const OP_IsNull = 50 +const OP_IsNull = 51 const OP_IsTrue = 91 const OP_IsType = 18 const OP_JournalMode = 4 const OP_Jump = 14 const OP_Last = 32 -const OP_Le = 55 +const OP_Le = 56 const OP_LoadAnalysis = 150 -const OP_Lt = 56 +const OP_Lt = 57 const OP_MakeRecord = 97 const OP_MaxPgcnt = 179 const OP_MemMax = 159 const OP_Move = 79 -const OP_Multiply = 108 +const OP_Multiply = 109 const OP_MustBeInt = 13 -const OP_Ne = 52 +const OP_Ne = 53 const OP_NewRowid = 127 const OP_Next = 39 const OP_NoConflict = 27 @@ -1023,17 +1030,17 @@ const OP_Noop = 187 const OP_Not = 19 const OP_NotExists = 31 const OP_NotFound = 28 -const OP_NotNull = 51 +const OP_NotNull = 52 const OP_Null = 75 const OP_NullRow = 136 const OP_Offset = 93 const OP_OffsetLimit = 160 const OP_Once = 15 const OP_OpenAutoindex = 116 -const OP_OpenDup = 115 -const OP_OpenEphemeral = 118 +const OP_OpenDup = 114 +const OP_OpenEphemeral = 117 const OP_OpenPseudo = 121 -const OP_OpenRead = 112 +const OP_OpenRead = 102 const OP_OpenWrite = 113 const OP_Or = 43 const OP_Pagecount = 178 @@ -1044,10 +1051,10 @@ const OP_Prev = 38 const OP_Program = 48 const OP_PureFunc = 65 const OP_ReadCookie = 99 -const OP_Real = 153 +const OP_Real = 154 const OP_RealAffinity = 87 const OP_ReleaseReg = 186 -const OP_Remainder = 110 +const OP_Remainder = 111 const OP_ReopenIdx = 101 const OP_ResetCount = 131 const OP_ResetSorter = 146 @@ -1074,8 +1081,8 @@ const OP_Sequence = 126 const OP_SequenceTest = 120 const OP_SetCookie = 100 const OP_SetSubtype = 182 -const OP_ShiftLeft = 104 -const OP_ShiftRight = 105 +const OP_ShiftLeft = 105 +const OP_ShiftRight = 106 const OP_SoftNull = 76 const OP_Sort = 35 const OP_SorterCompare = 132 @@ -1086,8 +1093,8 @@ const OP_SorterOpen = 119 const OP_SorterSort = 34 const OP_SqlExec = 148 const OP_String = 73 -const OP_String8 = 117 -const OP_Subtract = 107 +const OP_String8 = 118 +const OP_Subtract = 108 const OP_TableLock = 169 const OP_Trace = 184 const OP_Transaction = 2 @@ -1150,6 +1157,7 @@ const P4_NOTUSED = 0 const P4_REAL = -12 const P4_STATIC = -1 const P4_SUBPROGRAM = -4 +const P4_SUBRTNSIG = -17 const P4_TABLE = -5 const P4_TABLEREF = -16 const P4_TRANSIENT = 0 @@ -1620,6 +1628,9 @@ const SQLITE_CursorHints = 1024 const SQLITE_DBCONFIG_DEFENSIVE = 1010 const SQLITE_DBCONFIG_DQS_DDL = 1014 const SQLITE_DBCONFIG_DQS_DML = 1013 +const SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE = 1020 +const SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE = 1021 +const SQLITE_DBCONFIG_ENABLE_COMMENTS = 1022 const SQLITE_DBCONFIG_ENABLE_FKEY = 1002 const SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004 const SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005 @@ -1630,7 +1641,7 @@ const SQLITE_DBCONFIG_LEGACY_ALTER_TABLE = 1012 const SQLITE_DBCONFIG_LEGACY_FILE_FORMAT = 1016 const SQLITE_DBCONFIG_LOOKASIDE = 1001 const SQLITE_DBCONFIG_MAINDBNAME = 1000 -const SQLITE_DBCONFIG_MAX = 1019 +const SQLITE_DBCONFIG_MAX = 1022 const SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE = 1006 const SQLITE_DBCONFIG_RESET_DATABASE = 1009 const SQLITE_DBCONFIG_REVERSE_SCANORDER = 1019 @@ -1748,6 +1759,7 @@ const SQLITE_FCNTL_LAST_ERRNO = 4 const SQLITE_FCNTL_LOCKSTATE = 1 const SQLITE_FCNTL_LOCK_TIMEOUT = 34 const SQLITE_FCNTL_MMAP_SIZE = 18 +const SQLITE_FCNTL_NULL_IO = 43 const SQLITE_FCNTL_OVERWRITE = 11 const SQLITE_FCNTL_PDB = 30 const SQLITE_FCNTL_PERSIST_WAL = 10 @@ -1836,6 +1848,7 @@ const SQLITE_INDEX_CONSTRAINT_MATCH = 64 const SQLITE_INDEX_CONSTRAINT_NE = 68 const SQLITE_INDEX_CONSTRAINT_OFFSET = 74 const SQLITE_INDEX_CONSTRAINT_REGEXP = 67 +const SQLITE_INDEX_SCAN_HEX = 2 const SQLITE_INDEX_SCAN_UNIQUE = 1 const SQLITE_INNOCUOUS = 2097152 const SQLITE_INSERT = 18 @@ -1857,6 +1870,7 @@ const SQLITE_IOCAP_IMMUTABLE = 8192 const SQLITE_IOCAP_POWERSAFE_OVERWRITE = 4096 const SQLITE_IOCAP_SAFE_APPEND = 512 const SQLITE_IOCAP_SEQUENTIAL = 1024 +const SQLITE_IOCAP_SUBPAGE_READ = 32768 const SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN = 2048 const SQLITE_IOERR = 10 const SQLITE_IOERR_ACCESS = 3338 @@ -1934,7 +1948,7 @@ const SQLITE_MAX_DB = 12 const SQLITE_MAX_DEFAULT_PAGE_SIZE = 8192 const SQLITE_MAX_EXPR_DEPTH = 1000 const SQLITE_MAX_FILE_FORMAT = 4 -const SQLITE_MAX_FUNCTION_ARG = 127 +const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 const SQLITE_MAX_MEMORY = 0 @@ -1955,6 +1969,7 @@ const SQLITE_MAX_VDBE_OP = 250000000 const SQLITE_MAX_WORKER_THREADS = 8 const SQLITE_MEMDB_DEFAULT_MAXSIZE = 1073741824 const SQLITE_MINIMUM_FILE_DESCRIPTOR = 3 +const SQLITE_MIN_LENGTH = 30 const SQLITE_MISMATCH = 20 const SQLITE_MISUSE = 21 const SQLITE_MISUSE_BKPT = 0 @@ -2033,10 +2048,12 @@ const SQLITE_OmitNoopJoin = 256 const SQLITE_OmitOrderBy = 262144 const SQLITE_OnePass = 134217728 const SQLITE_OrderByIdxJoin = 64 +const SQLITE_OrderBySubq = 268435456 const SQLITE_PERM = 3 const SQLITE_POWERSAFE_OVERWRITE = 1 const SQLITE_PRAGMA = 19 -const SQLITE_PREPARE_MASK = 15 +const SQLITE_PREPARE_DONT_LOG = 16 +const SQLITE_PREPARE_MASK = 31 const SQLITE_PREPARE_NORMALIZE = 2 const SQLITE_PREPARE_NO_VTAB = 4 const SQLITE_PREPARE_PERSISTENT = 1 @@ -2091,6 +2108,7 @@ const SQLITE_SCANSTAT_PARENTID = 6 const SQLITE_SCANSTAT_SELECTID = 5 const SQLITE_SCHEMA = 17 const SQLITE_SELECT = 21 +const SQLITE_SELFORDER1 = 33554432 const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 @@ -2103,7 +2121,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33" +const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2144,6 +2162,7 @@ const SQLITE_SeekScan = 131072 const SQLITE_ShortColNames = 64 const SQLITE_SimplifyJoin = 8192 const SQLITE_SkipScan = 16384 +const SQLITE_StarQuery = 536870912 const SQLITE_Stat4 = 2048 const SQLITE_StmtScanStatus = 1024 const SQLITE_TEMP_FILE_PREFIX = "etilqs_" @@ -2158,6 +2177,7 @@ const SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS = 29 const SQLITE_TESTCTRL_FAULT_INSTALL = 9 const SQLITE_TESTCTRL_FIRST = 5 const SQLITE_TESTCTRL_FK_NO_ACTION = 7 +const SQLITE_TESTCTRL_GETOPT = 16 const SQLITE_TESTCTRL_IMPOSTER = 25 const SQLITE_TESTCTRL_INTERNAL_FUNCTIONS = 17 const SQLITE_TESTCTRL_ISINIT = 23 @@ -2211,8 +2231,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.46.1" -const SQLITE_VERSION_NUMBER = 3046001 +const SQLITE_VERSION = "3.49.0" +const SQLITE_VERSION_NUMBER = 3049000 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -2424,188 +2444,189 @@ const TIOCSWINSZ = 21524 const TIOCVHANGUP = 21559 const TK_ABORT = 27 const TK_ACTION = 28 -const TK_ADD = 163 +const TK_ADD = 164 const TK_AFTER = 29 -const TK_AGG_COLUMN = 169 -const TK_AGG_FUNCTION = 168 -const TK_ALL = 135 -const TK_ALTER = 162 -const TK_ALWAYS = 96 +const TK_AGG_COLUMN = 170 +const TK_AGG_FUNCTION = 169 +const TK_ALL = 136 +const TK_ALTER = 163 +const TK_ALWAYS = 97 const TK_ANALYZE = 30 const TK_AND = 44 -const TK_ANY = 101 +const TK_ANY = 102 const TK_AS = 24 const TK_ASC = 31 const TK_ASTERISK = 180 const TK_ATTACH = 32 -const TK_AUTOINCR = 126 +const TK_AUTOINCR = 127 const TK_BEFORE = 33 const TK_BEGIN = 5 -const TK_BETWEEN = 48 -const TK_BITAND = 102 -const TK_BITNOT = 114 -const TK_BITOR = 103 -const TK_BLOB = 154 +const TK_BETWEEN = 49 +const TK_BITAND = 103 +const TK_BITNOT = 115 +const TK_BITOR = 104 +const TK_BLOB = 155 const TK_BY = 34 const TK_CASCADE = 35 -const TK_CASE = 157 +const TK_CASE = 158 const TK_CAST = 36 -const TK_CHECK = 124 -const TK_COLLATE = 113 -const TK_COLUMN = 167 -const TK_COLUMNKW = 60 +const TK_CHECK = 125 +const TK_COLLATE = 114 +const TK_COLUMN = 168 +const TK_COLUMNKW = 61 const TK_COMMA = 25 +const TK_COMMENT = 185 const TK_COMMIT = 10 -const TK_CONCAT = 111 +const TK_CONCAT = 112 const TK_CONFLICT = 37 -const TK_CONSTRAINT = 119 +const TK_CONSTRAINT = 120 const TK_CREATE = 17 -const TK_CTIME_KW = 100 -const TK_CURRENT = 85 +const TK_CTIME_KW = 101 +const TK_CURRENT = 86 const TK_DATABASE = 38 -const TK_DEFAULT = 120 -const TK_DEFERRABLE = 131 +const TK_DEFAULT = 121 +const TK_DEFERRABLE = 132 const TK_DEFERRED = 7 -const TK_DELETE = 128 +const TK_DELETE = 129 const TK_DESC = 39 const TK_DETACH = 40 -const TK_DISTINCT = 140 -const TK_DO = 61 -const TK_DOT = 141 -const TK_DROP = 133 +const TK_DISTINCT = 141 +const TK_DO = 62 +const TK_DOT = 142 +const TK_DROP = 134 const TK_EACH = 41 -const TK_ELSE = 160 +const TK_ELSE = 161 const TK_END = 11 -const TK_EQ = 53 +const TK_EQ = 54 const TK_ERROR = 182 -const TK_ESCAPE = 58 -const TK_EXCEPT = 136 -const TK_EXCLUDE = 91 +const TK_ESCAPE = 59 +const TK_EXCEPT = 137 +const TK_EXCLUDE = 92 const TK_EXCLUSIVE = 9 const TK_EXISTS = 20 const TK_EXPLAIN = 2 const TK_FAIL = 42 -const TK_FILTER = 166 -const TK_FIRST = 83 -const TK_FLOAT = 153 -const TK_FOLLOWING = 86 -const TK_FOR = 62 -const TK_FOREIGN = 132 -const TK_FROM = 142 +const TK_FILTER = 167 +const TK_FIRST = 84 +const TK_FLOAT = 154 +const TK_FOLLOWING = 87 +const TK_FOR = 63 +const TK_FOREIGN = 133 +const TK_FROM = 143 const TK_FUNCTION = 172 -const TK_GE = 57 -const TK_GENERATED = 95 -const TK_GROUP = 146 -const TK_GROUPS = 92 -const TK_GT = 54 -const TK_HAVING = 147 -const TK_ID = 59 +const TK_GE = 58 +const TK_GENERATED = 96 +const TK_GROUP = 147 +const TK_GROUPS = 93 +const TK_GT = 55 +const TK_HAVING = 148 +const TK_ID = 60 const TK_IF = 18 const TK_IF_NULL_ROW = 179 -const TK_IGNORE = 63 -const TK_ILLEGAL = 185 +const TK_IGNORE = 64 +const TK_ILLEGAL = 186 const TK_IMMEDIATE = 8 -const TK_IN = 49 -const TK_INDEX = 161 -const TK_INDEXED = 116 -const TK_INITIALLY = 64 -const TK_INSERT = 127 -const TK_INSTEAD = 65 -const TK_INTEGER = 155 -const TK_INTERSECT = 137 -const TK_INTO = 151 +const TK_IN = 50 +const TK_INDEX = 162 +const TK_INDEXED = 117 +const TK_INITIALLY = 65 +const TK_INSERT = 128 +const TK_INSTEAD = 66 +const TK_INTEGER = 156 +const TK_INTERSECT = 138 +const TK_INTO = 152 const TK_IS = 45 -const TK_ISNOT = 171 -const TK_ISNULL = 50 -const TK_JOIN = 143 -const TK_JOIN_KW = 118 -const TK_KEY = 67 -const TK_LAST = 84 -const TK_LE = 55 -const TK_LIKE_KW = 47 -const TK_LIMIT = 148 +const TK_ISNOT = 46 +const TK_ISNULL = 51 +const TK_JOIN = 144 +const TK_JOIN_KW = 119 +const TK_KEY = 68 +const TK_LAST = 85 +const TK_LE = 56 +const TK_LIKE_KW = 48 +const TK_LIMIT = 149 const TK_LP = 22 -const TK_LSHIFT = 104 -const TK_LT = 56 -const TK_MATCH = 46 -const TK_MATERIALIZED = 97 -const TK_MINUS = 107 -const TK_NE = 52 -const TK_NO = 66 +const TK_LSHIFT = 105 +const TK_LT = 57 +const TK_MATCH = 47 +const TK_MATERIALIZED = 98 +const TK_MINUS = 108 +const TK_NE = 53 +const TK_NO = 67 const TK_NOT = 19 -const TK_NOTHING = 152 -const TK_NOTNULL = 51 -const TK_NULL = 121 -const TK_NULLS = 82 -const TK_OF = 68 -const TK_OFFSET = 69 -const TK_ON = 115 +const TK_NOTHING = 153 +const TK_NOTNULL = 52 +const TK_NULL = 122 +const TK_NULLS = 83 +const TK_OF = 69 +const TK_OFFSET = 70 +const TK_ON = 116 const TK_OR = 43 -const TK_ORDER = 145 -const TK_OTHERS = 93 -const TK_OVER = 165 -const TK_PARTITION = 87 +const TK_ORDER = 146 +const TK_OTHERS = 94 +const TK_OVER = 166 +const TK_PARTITION = 88 const TK_PLAN = 4 -const TK_PLUS = 106 -const TK_PRAGMA = 70 -const TK_PRECEDING = 88 -const TK_PRIMARY = 122 -const TK_PTR = 112 +const TK_PLUS = 107 +const TK_PRAGMA = 71 +const TK_PRECEDING = 89 +const TK_PRIMARY = 123 +const TK_PTR = 113 const TK_QNUMBER = 183 const TK_QUERY = 3 -const TK_RAISE = 71 -const TK_RANGE = 89 -const TK_RECURSIVE = 72 -const TK_REFERENCES = 125 +const TK_RAISE = 72 +const TK_RANGE = 90 +const TK_RECURSIVE = 73 +const TK_REFERENCES = 126 const TK_REGISTER = 176 -const TK_REINDEX = 98 +const TK_REINDEX = 99 const TK_RELEASE = 14 -const TK_REM = 110 -const TK_RENAME = 99 -const TK_REPLACE = 73 -const TK_RESTRICT = 74 -const TK_RETURNING = 150 +const TK_REM = 111 +const TK_RENAME = 100 +const TK_REPLACE = 74 +const TK_RESTRICT = 75 +const TK_RETURNING = 151 const TK_ROLLBACK = 12 -const TK_ROW = 75 -const TK_ROWS = 76 +const TK_ROW = 76 +const TK_ROWS = 77 const TK_RP = 23 -const TK_RSHIFT = 105 +const TK_RSHIFT = 106 const TK_SAVEPOINT = 13 -const TK_SELECT = 138 +const TK_SELECT = 139 const TK_SELECT_COLUMN = 178 const TK_SEMI = 1 -const TK_SET = 130 -const TK_SLASH = 109 +const TK_SET = 131 +const TK_SLASH = 110 const TK_SPACE = 184 const TK_SPAN = 181 -const TK_STAR = 108 -const TK_STRING = 117 +const TK_STAR = 109 +const TK_STRING = 118 const TK_TABLE = 16 const TK_TEMP = 21 -const TK_THEN = 159 -const TK_TIES = 94 +const TK_THEN = 160 +const TK_TIES = 95 const TK_TO = 15 const TK_TRANSACTION = 6 -const TK_TRIGGER = 77 -const TK_TRUEFALSE = 170 +const TK_TRIGGER = 78 +const TK_TRUEFALSE = 171 const TK_TRUTH = 175 const TK_UMINUS = 174 -const TK_UNBOUNDED = 90 -const TK_UNION = 134 -const TK_UNIQUE = 123 -const TK_UPDATE = 129 +const TK_UNBOUNDED = 91 +const TK_UNION = 135 +const TK_UNIQUE = 124 +const TK_UPDATE = 130 const TK_UPLUS = 173 -const TK_USING = 144 -const TK_VACUUM = 78 -const TK_VALUES = 139 -const TK_VARIABLE = 156 +const TK_USING = 145 +const TK_VACUUM = 79 +const TK_VALUES = 140 +const TK_VARIABLE = 157 const TK_VECTOR = 177 -const TK_VIEW = 79 -const TK_VIRTUAL = 80 -const TK_WHEN = 158 -const TK_WHERE = 149 -const TK_WINDOW = 164 -const TK_WITH = 81 +const TK_VIEW = 80 +const TK_VIRTUAL = 81 +const TK_WHEN = 159 +const TK_WHERE = 150 +const TK_WINDOW = 165 +const TK_WITH = 82 const TK_WITHOUT = 26 const TMP_MAX = 10000 const TOKEN = 0 @@ -2672,6 +2693,7 @@ const WHERE_COLUMN_IN = 4 const WHERE_COLUMN_NULL = 8 const WHERE_COLUMN_RANGE = 2 const WHERE_CONSTRAINT = 15 +const WHERE_COROUTINE = 33554432 const WHERE_DISTINCTBY = 128 const WHERE_DISTINCT_NOOP = 0 const WHERE_DISTINCT_ORDERED = 2 @@ -2747,32 +2769,32 @@ const YYFALLBACK = 1 const YYFREE = 0 const YYGROWABLESTACK = 1 const YYMALLOCARGTYPE = 0 -const YYNOCODE = 322 +const YYNOCODE = 323 const YYNOERRORRECOVERY = 1 const YYNRULE = 409 const YYNRULE_WITH_ACTION = 344 const YYNSTATE = 583 -const YYNTOKEN = 186 +const YYNTOKEN = 187 const YYPARSEFREENEVERNULL = 1 const YYREALLOC = 0 const YYSTACKDEPTH = 100 -const YYWILDCARD = 101 +const YYWILDCARD = 102 const YY_ACCEPT_ACTION = 1255 -const YY_ACTTAB_COUNT = 2142 +const YY_ACTTAB_COUNT = 2207 const YY_ERROR_ACTION = 1254 -const YY_MAX_DSTRCTR = 319 +const YY_MAX_DSTRCTR = 320 const YY_MAX_REDUCE = 1665 const YY_MAX_SHIFT = 582 const YY_MAX_SHIFTREDUCE = 1253 -const YY_MIN_DSTRCTR = 205 +const YY_MIN_DSTRCTR = 206 const YY_MIN_REDUCE = 1257 const YY_MIN_SHIFTREDUCE = 845 const YY_NO_ACTION = 1256 -const YY_REDUCE_COUNT = 411 -const YY_REDUCE_MAX = 1798 -const YY_REDUCE_MIN = -275 +const YY_REDUCE_COUNT = 412 +const YY_REDUCE_MAX = 1772 +const YY_REDUCE_MIN = -277 const YY_SHIFT_COUNT = 582 -const YY_SHIFT_MAX = 2128 +const YY_SHIFT_MAX = 2152 const YY_SHIFT_MIN = 0 const _CS_GNU_LIBC_VERSION = 2 const _CS_GNU_LIBPTHREAD_VERSION = 3 @@ -3768,6 +3790,13 @@ type sqlite3_callback = Tsqlite3_callback ** filesystem supports doing multiple write operations atomically when those ** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and ** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. +** +** The SQLITE_IOCAP_SUBPAGE_READ property means that it is ok to read +** from the database file in amounts that are not a multiple of the +** page size and that do not begin at a page boundary. Without this +** property, SQLite is careful to only do full-page reads and write +** on aligned pages, with the one exception that it will do a sub-page +** read of the first page to access the database header. */ /* @@ -3876,8 +3905,8 @@ type sqlite3_file1 = Tsqlite3_file1 // ** to xUnlock() is a no-op. // ** The xCheckReservedLock() method checks whether any database connection, // ** either in this process or in some other process, is holding a RESERVED, -// ** PENDING, or EXCLUSIVE lock on the file. It returns true -// ** if such a lock exists and false otherwise. +// ** PENDING, or EXCLUSIVE lock on the file. It returns, via its output +// ** pointer parameter, true if such a lock exists and false otherwise. // ** // ** The xFileControl() method is a generic interface that allows custom // ** VFS implementations to directly control an open file using the @@ -3918,6 +3947,7 @@ type sqlite3_file1 = Tsqlite3_file1 // ** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE] // ** <li> [SQLITE_IOCAP_IMMUTABLE] // ** <li> [SQLITE_IOCAP_BATCH_ATOMIC] +// ** <li> [SQLITE_IOCAP_SUBPAGE_READ] // ** </ul> // ** // ** The SQLITE_IOCAP_ATOMIC property means that all writes of @@ -4697,7 +4727,7 @@ type Tsqlite3_context = struct { FisError int32 Fenc Tu8 FskipFlag Tu8 - Fargc Tu8 + Fargc Tu16 Fargv [1]uintptr } @@ -4911,9 +4941,11 @@ type sqlite3_module1 = Tsqlite3_module1 ** will be returned by the strategy. ** ** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - -** SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite -** assumes that the strategy may visit at most one row. +** mask of SQLITE_INDEX_SCAN_* flags. One such flag is +** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] +** output to show the idxNum has hex instead of as decimal. Another flag is +** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will +** return at most one row. ** ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then ** SQLite also assumes that if a call to the xUpdate() method is made as @@ -5476,6 +5508,8 @@ type sqlite3_snapshot = Tsqlite3_snapshot ** builds on processors without floating point support. */ +/* #endif for SQLITE3_H will be added by mksqlite3.tcl */ + /******** Begin file sqlite3rtree.h *********/ /* ** 2010 August 30 @@ -5953,6 +5987,8 @@ type TFts5ExtensionApi = struct { FxPhraseNextColumn uintptr FxQueryToken uintptr FxInstToken uintptr + FxColumnLocale uintptr + FxTokenize_v2 uintptr } type Fts5ExtensionApi = TFts5ExtensionApi @@ -6162,6 +6198,10 @@ type Fts5PhraseIter1 = TFts5PhraseIter1 ** (i.e. if it is a contentless table), then this API always iterates ** through an empty set (all calls to xPhraseFirst() set iCol to -1). ** +** In all cases, matches are visited in (column ASC, offset ASC) order. +** i.e. all those in column 0, sorted by offset, followed by those in +** column 1, etc. +** ** xPhraseNext() ** See xPhraseFirst above. ** @@ -6220,16 +6260,54 @@ type Fts5PhraseIter1 = TFts5PhraseIter1 ** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, ** output variable (*ppToken) is set to point to a buffer containing the ** matching document token, and (*pnToken) to the size of that buffer in -** bytes. This API is not available if the specified token matches a -** prefix query term. In that case both output variables are always set -** to 0. +** bytes. ** ** The output text is not a copy of the document text that was tokenized. ** It is the output of the tokenizer module. For tokendata=1 tables, this ** includes any embedded 0x00 and trailing data. ** +** This API may be slow in some cases if the token identified by parameters +** iIdx and iToken matched a prefix token in the query. In most cases, the +** first call to this API for each prefix token in the query is forced +** to scan the portion of the full-text index that matches the prefix +** token to collect the extra data required by this API. If the prefix +** token matches a large number of token instances in the document set, +** this may be a performance problem. +** +** If the user knows in advance that a query may use this API for a +** prefix token, FTS5 may be configured to collect all required data as part +** of the initial querying of the full-text index, avoiding the second scan +** entirely. This also causes prefix queries that do not use this API to +** run more slowly and use more memory. FTS5 may be configured in this way +** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] +** option, or on a per-query basis using the +** [fts5_insttoken | fts5_insttoken()] user function. +** ** This API can be quite slow if used with an FTS5 table created with the ** "detail=none" or "detail=column" option. +** +** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) +** If parameter iCol is less than zero, or greater than or equal to the +** number of columns in the table, SQLITE_RANGE is returned. +** +** Otherwise, this function attempts to retrieve the locale associated +** with column iCol of the current row. Usually, there is no associated +** locale, and output parameters (*pzLocale) and (*pnLocale) are set +** to NULL and 0, respectively. However, if the fts5_locale() function +** was used to associate a locale with the value when it was inserted +** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated +** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) +** is set to the size in bytes of the buffer, not including the +** nul-terminator. +** +** If successful, SQLITE_OK is returned. Or, if an error occurs, an +** SQLite error code is returned. The final value of the output parameters +** is undefined in this case. +** +** xTokenize_v2: +** Tokenize text using the tokenizer belonging to the FTS5 table. This +** API is the same as the xTokenize() API, except that it allows a tokenizer +** locale to be specified. */ type TFts5ExtensionApi1 = struct { FiVersion int32 @@ -6254,10 +6332,37 @@ type TFts5ExtensionApi1 = struct { FxPhraseNextColumn uintptr FxQueryToken uintptr FxInstToken uintptr + FxColumnLocale uintptr + FxTokenize_v2 uintptr } type Fts5ExtensionApi1 = TFts5ExtensionApi1 +type Tfts5_tokenizer_v2 = struct { + FiVersion int32 + FxCreate uintptr + FxDelete uintptr + FxTokenize uintptr +} + +type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 + +type Tfts5_tokenizer_v21 = struct { + FiVersion int32 + FxCreate uintptr + FxDelete uintptr + FxTokenize uintptr +} + +type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 + +// C documentation +// +// /* +// ** New code should use the fts5_tokenizer_v2 type to define tokenizer +// ** implementations. The following type is included for legacy applications +// ** that still use it. +// */ type Tfts5_tokenizer = struct { FxCreate uintptr FxDelete uintptr @@ -6289,19 +6394,23 @@ type fts5_tokenizer1 = Tfts5_tokenizer1 // ** FTS5 EXTENSION REGISTRATION API // */ type Tfts5_api = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr + FiVersion int32 + FxCreateTokenizer uintptr + FxFindTokenizer uintptr + FxCreateFunction uintptr + FxCreateTokenizer_v2 uintptr + FxFindTokenizer_v2 uintptr } type fts5_api = Tfts5_api type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr + FiVersion int32 + FxCreateTokenizer uintptr + FxFindTokenizer uintptr + FxCreateFunction uintptr + FxCreateTokenizer_v2 uintptr + FxFindTokenizer_v2 uintptr } type fts5_api1 = Tfts5_api1 @@ -6398,6 +6507,10 @@ type fts5_api1 = Tfts5_api1 /* ** The maximum number of arguments to an SQL function. +** +** This value has a hard upper limit of 32767 due to storage +** constraints (it needs to fit inside a i16). We keep it +** lower than that to prevent abuse. */ /* @@ -7054,7 +7167,7 @@ type uptr = Tuptr ** 0xFFFF---- Low-level debug messages ** ** 0x00000001 Code generation -** 0x00000002 Solver +** 0x00000002 Solver (Use 0x40000 for less detail) ** 0x00000004 Solver costs ** 0x00000008 WhereLoop inserts ** @@ -7073,6 +7186,8 @@ type uptr = Tuptr ** ** 0x00010000 Show more detail when printing WHERE terms ** 0x00020000 Show WHERE terms returned from whereScanNext() +** 0x00040000 Solver overview messages +** 0x00080000 Star-query heuristic */ // C documentation @@ -7400,7 +7515,7 @@ type TFuncDestructor = struct { type FuncDestructor = TFuncDestructor type TFuncDef = struct { - FnArg Ti8 + FnArg Ti16 FfuncFlags Tu32 FpUserData uintptr FpNext uintptr @@ -7425,7 +7540,6 @@ type FuncDefHash = TFuncDefHash type TIdList = struct { FnId int32 - FeU4 Tu8 Fa [1]TIdList_item } @@ -7574,6 +7688,7 @@ type TParse = struct { FprepFlags Tu8 FwithinRJSubrtn Tu8 FbHasWith Tu8 + FmSubrtnSig Tu8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -7660,9 +7775,11 @@ type TPreUpdate = struct { FiBlobWrite int32 FiKey1 Ti64 FiKey2 Ti64 + Foldipk TMem FaNew uintptr FpTab uintptr FpPk uintptr + FapDflt uintptr } type PreUpdate = TPreUpdate @@ -7769,27 +7886,24 @@ type TSelectDest = struct { type SelectDest = TSelectDest -type TSrcItem = struct { - FpSchema uintptr - FzDatabase uintptr - FzName uintptr - FzAlias uintptr - FpTab uintptr +type TSubquery = struct { FpSelect uintptr FaddrFillSub int32 FregReturn int32 FregResult int32 - Ffg struct { - F__ccgo_align [0]uint32 - Fjointype Tu8 - F__ccgo_align1 [2]byte - F__ccgo4 uint16 +} + +type Subquery = TSubquery + +type TSrcItem = struct { + FzName uintptr + FzAlias uintptr + FpSTab uintptr + Ffg struct { + Fjointype Tu8 + F__ccgo4 uint32 } FiCursor int32 - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } FcolUsed TBitmask Fu1 struct { FpFuncArg [0]uintptr @@ -7800,6 +7914,15 @@ type TSrcItem = struct { FpCteUse [0]uintptr FpIBIndex uintptr } + Fu3 struct { + FpUsing [0]uintptr + FpOn uintptr + } + Fu4 struct { + FzDatabase [0]uintptr + FpSubq [0]uintptr + FpSchema uintptr + } } type SrcItem = TSrcItem @@ -8558,6 +8681,32 @@ type TSubProgram = struct { type SubProgram = TSubProgram +type TSubrtnSig = struct { + FselId int32 + FbComplete Tu8 + FzAff uintptr + FiTable int32 + FiAddr int32 + FregReturn int32 +} + +type SubrtnSig = TSubrtnSig + +/* +** A signature for a reusable subroutine that materializes the RHS of +** an IN operator. + */ +type TSubrtnSig1 = struct { + FselId int32 + FbComplete Tu8 + FzAff uintptr + FiTable int32 + FiAddr int32 + FregReturn int32 +} + +type SubrtnSig1 = TSubrtnSig1 + /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded @@ -9103,7 +9252,7 @@ type sqlite31 = Tsqlite31 ** field is used by per-connection app-def functions. */ type TFuncDef1 = struct { - FnArg Ti8 + FnArg Ti16 FfuncFlags Tu32 FpUserData uintptr FpNext uintptr @@ -9956,7 +10105,6 @@ type Expr1 = TExpr1 ** EP_Agg == NC_HasAgg == SF_HasAgg ** EP_Win == NC_HasWin */ -/* 0x80000000 // Available */ /* The EP_Propagate mask is a set of properties that automatically propagate ** upwards into parent nodes. @@ -10045,7 +10193,6 @@ type ExprList1 = TExprList1 */ type TIdList1 = struct { FnId int32 - FeU4 Tu8 Fa [1]TIdList_item } @@ -10057,6 +10204,18 @@ type IdList1 = TIdList1 */ /* +** Details of the implementation of a subquery. + */ +type TSubquery1 = struct { + FpSelect uintptr + FaddrFillSub int32 + FregReturn int32 + FregResult int32 +} + +type Subquery1 = TSubquery1 + +/* ** The SrcItem object represents a single term in the FROM clause of a query. ** The SrcList object is mostly an array of SrcItems. ** @@ -10068,36 +10227,40 @@ type IdList1 = TIdList1 ** 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. ** -** Union member validity: +** Aggressive use of "union" helps keep the size of the object small. This +** has been shown to boost performance, in addition to saving memory. +** Access to union elements is gated by the following rules which should +** always be checked, either by an if-statement or by an assert(). ** -** u1.zIndexedBy fg.isIndexedBy && !fg.isTabFunc -** u1.pFuncArg fg.isTabFunc && !fg.isIndexedBy +** Field Only access if this is true +** --------------- ----------------------------------- +** u1.zIndexedBy fg.isIndexedBy +** u1.pFuncArg fg.isTabFunc ** u1.nRow !fg.isTabFunc && !fg.isIndexedBy ** -** u2.pIBIndex fg.isIndexedBy && !fg.isCte -** u2.pCteUse fg.isCte && !fg.isIndexedBy +** u2.pIBIndex fg.isIndexedBy +** u2.pCteUse fg.isCte +** +** u3.pOn !fg.isUsing +** u3.pUsing fg.isUsing +** +** u4.zDatabase !fg.fixedSchema && !fg.isSubquery +** u4.pSchema fg.fixedSchema +** u4.pSubq fg.isSubquery +** +** See also the sqlite3SrcListDelete() routine for assert() statements that +** check invariants on the fields of this object, especially the flags +** inside the fg struct. */ type TSrcItem1 = struct { - FpSchema uintptr - FzDatabase uintptr - FzName uintptr - FzAlias uintptr - FpTab uintptr - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 - Ffg struct { - F__ccgo_align [0]uint32 - Fjointype Tu8 - F__ccgo_align1 [2]byte - F__ccgo4 uint16 + FzName uintptr + FzAlias uintptr + FpSTab uintptr + Ffg struct { + Fjointype Tu8 + F__ccgo4 uint32 } FiCursor int32 - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } FcolUsed TBitmask Fu1 struct { FpFuncArg [0]uintptr @@ -10108,6 +10271,15 @@ type TSrcItem1 = struct { FpCteUse [0]uintptr FpIBIndex uintptr } + Fu3 struct { + FpUsing [0]uintptr + FpOn uintptr + } + Fu4 struct { + FzDatabase [0]uintptr + FpSubq [0]uintptr + FpSchema uintptr + } } type SrcItem1 = TSrcItem1 @@ -10204,6 +10376,7 @@ type NameContext1 = TNameContext1 ** NC_HasWin == EP_Win ** */ +/* 0x002000 // available for reuse */ /* ** An instance of the following object describes a single ON CONFLICT @@ -10289,7 +10462,7 @@ type Select1 = TSelect1 ** SF_FixedLimit == WHERE_USE_LIMIT */ -/* True if S exists and has SF_NestedFrom */ +/* True if SrcItem X is a subquery that has SF_NestedFrom */ /* ** The results of a SELECT can be distributed in several ways, as defined @@ -10319,7 +10492,11 @@ type Select1 = TSelect1 ** SRT_Set The result must be a single column. Store each ** row of result as the key in table pDest->iSDParm. ** Apply the affinity pDest->affSdst before storing -** results. Used to implement "IN (SELECT ...)". +** results. if pDest->iSDParm2 is positive, then it is +** a register holding a Bloom filter for the IN operator +** that should be populated in addition to the +** pDest->iSDParm table. This SRT is used to +** implement "IN (SELECT ...)". ** ** SRT_EphemTab Create an temporary table pDest->iSDParm and store ** the result there. The cursor is left open after @@ -10505,6 +10682,7 @@ type TParse1 = struct { FprepFlags Tu8 FwithinRJSubrtn Tu8 FbHasWith Tu8 + FmSubrtnSig Tu8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -10792,7 +10970,6 @@ type TSqlite3Config = struct { FbUseCis Tu8 FbSmallMalloc Tu8 FbExtraSchemaChecks Tu8 - FbUseLongDouble Tu8 FmxStrlen int32 FneverCorrupt int32 FszLookaside int32 @@ -11187,21 +11364,21 @@ var _sqlite3azCompileOpt = [54]uintptr{ 36: __ccgo_ts + 755, 37: __ccgo_ts + 782, 38: __ccgo_ts + 802, - 39: __ccgo_ts + 823, - 40: __ccgo_ts + 845, - 41: __ccgo_ts + 875, - 42: __ccgo_ts + 900, - 43: __ccgo_ts + 926, - 44: __ccgo_ts + 946, - 45: __ccgo_ts + 972, - 46: __ccgo_ts + 995, - 47: __ccgo_ts + 1021, - 48: __ccgo_ts + 1043, - 49: __ccgo_ts + 1064, - 50: __ccgo_ts + 1075, - 51: __ccgo_ts + 1083, - 52: __ccgo_ts + 1097, - 53: __ccgo_ts + 1110, + 39: __ccgo_ts + 824, + 40: __ccgo_ts + 846, + 41: __ccgo_ts + 876, + 42: __ccgo_ts + 901, + 43: __ccgo_ts + 927, + 44: __ccgo_ts + 947, + 45: __ccgo_ts + 973, + 46: __ccgo_ts + 996, + 47: __ccgo_ts + 1022, + 48: __ccgo_ts + 1044, + 49: __ccgo_ts + 1065, + 50: __ccgo_ts + 1076, + 51: __ccgo_ts + 1084, + 52: __ccgo_ts + 1098, + 53: __ccgo_ts + 1111, } func _sqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) (r uintptr) { @@ -11911,14 +12088,14 @@ var _sqlite3OpcodeProperty = [190]uint8{ 49: uint8(0x01), 50: uint8(0x03), 51: uint8(0x03), - 52: uint8(0x0b), + 52: uint8(0x03), 53: uint8(0x0b), 54: uint8(0x0b), 55: uint8(0x0b), 56: uint8(0x0b), 57: uint8(0x0b), - 58: uint8(0x01), - 59: uint8(0x03), + 58: uint8(0x0b), + 59: uint8(0x01), 60: uint8(0x03), 61: uint8(0x03), 62: uint8(0x01), @@ -11945,7 +12122,7 @@ var _sqlite3OpcodeProperty = [190]uint8{ 98: uint8(0x10), 99: uint8(0x10), 101: uint8(0x40), - 102: uint8(0x26), + 102: uint8(0x40), 103: uint8(0x26), 104: uint8(0x26), 105: uint8(0x26), @@ -11955,12 +12132,12 @@ var _sqlite3OpcodeProperty = [190]uint8{ 109: uint8(0x26), 110: uint8(0x26), 111: uint8(0x26), - 112: uint8(0x40), - 114: uint8(0x12), - 115: uint8(0x40), + 112: uint8(0x26), + 114: uint8(0x40), + 115: uint8(0x12), 116: uint8(0x40), - 117: uint8(0x10), - 118: uint8(0x40), + 117: uint8(0x40), + 118: uint8(0x10), 122: uint8(0x40), 124: uint8(0x40), 125: uint8(0x40), @@ -11976,7 +12153,7 @@ var _sqlite3OpcodeProperty = [190]uint8{ 143: uint8(0x40), 144: uint8(0x10), 147: uint8(0x10), - 153: uint8(0x10), + 154: uint8(0x10), 156: uint8(0x06), 157: uint8(0x10), 159: uint8(0x04), @@ -12032,12 +12209,12 @@ var _sqlite3StdTypeAffinity = [6]uint8{ } var _sqlite3StdType = [6]uintptr{ - 0: __ccgo_ts + 1123, - 1: __ccgo_ts + 1127, - 2: __ccgo_ts + 1132, - 3: __ccgo_ts + 1136, - 4: __ccgo_ts + 1144, - 5: __ccgo_ts + 1149, + 0: __ccgo_ts + 1124, + 1: __ccgo_ts + 1128, + 2: __ccgo_ts + 1133, + 3: __ccgo_ts + 1137, + 4: __ccgo_ts + 1145, + 5: __ccgo_ts + 1150, } /************** End of global.c **********************************************/ @@ -12467,7 +12644,7 @@ type Tsqlite3_context1 = struct { FisError int32 Fenc Tu8 FskipFlag Tu8 - Fargc Tu8 + Fargc Tu16 Fargv [1]uintptr } @@ -12622,9 +12799,11 @@ type TPreUpdate1 = struct { FiBlobWrite int32 FiKey1 Ti64 FiKey2 Ti64 + Foldipk TMem FaNew uintptr FpTab uintptr FpPk uintptr + FapDflt uintptr } type PreUpdate1 = TPreUpdate1 @@ -12762,7 +12941,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(23961)) + return _sqlite3MisuseError(tls, int32(24298)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13275,7 +13454,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } } zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1154, libc.VaList(bp+16, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1155, libc.VaList(bp+16, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) @@ -13307,13 +13486,13 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { var _ /* s at bp+8 */ int32 _, _ = ms, rScale ms = float64(0) - if _getDigits(tls, zDate, __ccgo_ts+1162, libc.VaList(bp+24, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1163, libc.VaList(bp+24, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zDate))) == int32(':') { zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1170, libc.VaList(bp+24, bp+8)) != int32(1) { + if _getDigits(tls, zDate, __ccgo_ts+1171, libc.VaList(bp+24, bp+8)) != int32(1) { return int32(1) } zDate += uintptr(2) @@ -13326,6 +13505,11 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { zDate++ } ms /= rScale + /* Truncate to avoid problems with sub-milliseconds + ** rounding. https://sqlite.org/forum/forumpost/766a2c9231 */ + if ms > float64(0.999) { + ms = float64(0.999) + } } } else { *(*int32)(unsafe.Pointer(bp + 8)) = 0 @@ -13383,8 +13567,8 @@ func _computeJD(tls *libc.TLS, p uintptr) { Y-- M += int32(12) } - A = Y / int32(100) - B = int32(2) - A + A/int32(4) + A = (Y + int32(4800)) / int32(100) + B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) @@ -13458,7 +13642,7 @@ func _parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } else { neg = 0 } - if _getDigits(tls, zDate, __ccgo_ts+1174, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { + if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { return int32(1) } zDate += uintptr(10) @@ -13559,14 +13743,14 @@ func _parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) if _parseHhMmSs(tls, zDate, p) == 0 { return 0 } else { - if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1186) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { + if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1187) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { return _setDateTimeToCurrent(tls, context, p) } else { if _sqlite3AtoF(tls, zDate, bp, _sqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { _setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp))) return 0 } else { - if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1190) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1197) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { + if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1198) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) return _setDateTimeToCurrent(tls, context, p) } @@ -13602,8 +13786,8 @@ func _validJulianDay(tls *libc.TLS, iJD Tsqlite3_int64) (r int32) { // ** Compute the Year, Month, and Day from the julian day number. // */ func _computeYMD(tls *libc.TLS, p uintptr) { - var A, B, C, D, E, X1, Z, v1, v2 int32 - _, _, _, _, _, _, _, _, _ = A, B, C, D, E, X1, Z, v1, v2 + var A, B, C, D, E, X1, Z, alpha, v1, v2 int32 + _, _, _, _, _, _, _, _, _, _ = A, B, C, D, E, X1, Z, alpha, v1, v2 if (*TDateTime)(unsafe.Pointer(p)).FvalidYMD != 0 { return } @@ -13617,8 +13801,8 @@ func _computeYMD(tls *libc.TLS, p uintptr) { return } else { Z = int32(((*TDateTime)(unsafe.Pointer(p)).FiJD + libc.Int64FromInt32(43200000)) / libc.Int64FromInt32(86400000)) - A = int32((float64(Z) - libc.Float64FromFloat64(1.86721625e+06)) / libc.Float64FromFloat64(36524.25)) - A = Z + int32(1) + A - A/int32(4) + alpha = int32((float64(Z)+libc.Float64FromFloat64(32044.75))/libc.Float64FromFloat64(36524.25)) - int32(52) + A = Z + int32(1) + alpha - (alpha+int32(100))/int32(4) + int32(25) B = A + int32(1524) C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) @@ -13770,7 +13954,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) } if _osLocaltime(tls, bp, bp+8) != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1207, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1208, -int32(1)) return int32(SQLITE_ERROR) } (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_year + int32(1900) - iYearDiff @@ -13832,13 +14016,13 @@ var _aXformType = [6]struct { FnName: uint8(5), FzName: [7]uint8{'m', 'o', 'n', 't', 'h'}, FrLimit: float32(176546), - FrXform: float32(libc.Float64FromFloat64(30) * libc.Float64FromFloat64(86400)), + FrXform: float32(2.592e+06), }, 5: { FnName: uint8(4), FzName: [7]uint8{'y', 'e', 'a', 'r'}, FrLimit: float32(14713), - FrXform: float32(libc.Float64FromFloat64(365) * libc.Float64FromFloat64(86400)), + FrXform: float32(3.1536e+07), }, } @@ -13925,7 +14109,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** If rawS is available, then interpret as a julian day number, or ** a unix timestamp, depending on its magnitude. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1230) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1231) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-33611-57934 */ @@ -13940,7 +14124,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** month. As this is the default action, this modifier is really ** a no-op that is only included for symmetry. See "floor". */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1235) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1236) == 0 { _computeJD(tls, p) _clearYMD_HMS_TZ(tls, p) rc = 0 @@ -13953,7 +14137,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Resolve day-of-month overflow by rolling back to the end of the ** previous month. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1243) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1244) == 0 { _computeJD(tls, p) *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64(libc.Int32FromUint8((*TDateTime)(unsafe.Pointer(p)).FnFloor) * int32(86400000)) _clearYMD_HMS_TZ(tls, p) @@ -13968,7 +14152,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** value in the allowed range of julian day numbers understood by ** SQLite (0..5373484.5) then the result will be NULL. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1249) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1250) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-31176-64601 */ @@ -13983,7 +14167,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Assuming the current time value is UTC (a.k.a. GMT), shift it to ** show local time. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1259) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1260) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x10>>4)) != 0 { v1 = SQLITE_OK } else { @@ -14000,7 +14184,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Treat the current value of p->s as the number of ** seconds since 1970. Convert to a real julian day number. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1269) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1270) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ @@ -14013,7 +14197,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 } } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1279) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1280) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x8>>3)) == 0 { /* Guess at the corresponding utc time */ cnt = 0 /* Guess is off by this much */ _computeJD(tls, p) @@ -14060,7 +14244,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** 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 v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1283, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { + if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1284, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { v6 = int32(*(*float64)(unsafe.Pointer(bp))) n = v6 } @@ -14090,8 +14274,8 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Show subsecond precision in the output of datetime() and ** unixepoch() and strftime('%s'). */ - if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1292, int32(9)) != 0 { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1190) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1197) == 0 { + if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1293, int32(9)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1191) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1198) == 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) rc = 0 } @@ -14110,16 +14294,16 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) (*TDateTime)(unsafe.Pointer(p)).Ftz = 0 (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1302) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1303) == 0 { (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1308) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1309) == 0 { (*TDateTime)(unsafe.Pointer(p)).FM = int32(1) (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1313) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1314) == 0 { rc = 0 } } @@ -14161,10 +14345,10 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { - if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1317, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1318, libc.VaList(bp+136, bp+56)) == int32(1) { break } - if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1321, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { break } } @@ -14185,11 +14369,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } /* Must start with +/- */ if n == int32(5) { - if _getDigits(tls, z+1, __ccgo_ts+1325, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } } else { - if _getDigits(tls, z+1, __ccgo_ts+1337, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1338, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } z++ @@ -14227,7 +14411,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 break } - if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1162, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1163, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { z2 = z + 12 n = int32(2) } else { @@ -14704,9 +14888,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('e'): if libc.Int32FromUint8(cf) == int32('d') { - v3 = __ccgo_ts + 1349 + v3 = __ccgo_ts + 1350 } else { - v3 = __ccgo_ts + 1354 + v3 = __ccgo_ts + 1355 } Xsqlite3_str_appendf(tls, bp+48, v3, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('f'): /* Fractional seconds. (Non-standard) */ @@ -14714,9 +14898,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if s > float64(59.999) { s = float64(59.999) } - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1358, libc.VaList(bp+184, s)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, s)) case int32('F'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1365, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1366, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('G'): /* Fall thru */ fallthrough case int32('g'): @@ -14726,17 +14910,17 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*TDateTime)(unsafe.Pointer(bp + 80))).FvalidYMD = uint8(0) _computeYMD(tls, bp+80) if libc.Int32FromUint8(cf) == int32('g') { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1349, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) } else { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1380, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1381, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) } case int32('H'): fallthrough case int32('k'): if libc.Int32FromUint8(cf) == int32('H') { - v4 = __ccgo_ts + 1349 + v4 = __ccgo_ts + 1350 } else { - v4 = __ccgo_ts + 1354 + v4 = __ccgo_ts + 1355 } Xsqlite3_str_appendf(tls, bp+48, v4, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh)) case int32('I'): /* Fall thru */ @@ -14750,50 +14934,50 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { h = int32(12) } if libc.Int32FromUint8(cf) == int32('I') { - v5 = __ccgo_ts + 1349 + v5 = __ccgo_ts + 1350 } else { - v5 = __ccgo_ts + 1354 + v5 = __ccgo_ts + 1355 } Xsqlite3_str_appendf(tls, bp+48, v5, libc.VaList(bp+184, h)) case int32('j'): /* Day of year. Jan01==1, Jan02==2, and so forth */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1386, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) case int32('J'): /* Julian day number. (Non-standard) */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1391, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) case int32('m'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1349, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) case int32('M'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1349, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('p'): /* Fall thru */ fallthrough case int32('P'): if (*(*TDateTime)(unsafe.Pointer(bp))).Fh >= int32(12) { if libc.Int32FromUint8(cf) == int32('p') { - v6 = __ccgo_ts + 1396 + v6 = __ccgo_ts + 1397 } else { - v6 = __ccgo_ts + 1399 + v6 = __ccgo_ts + 1400 } Xsqlite3_str_append(tls, bp+48, v6, int32(2)) } else { if libc.Int32FromUint8(cf) == int32('p') { - v7 = __ccgo_ts + 1402 + v7 = __ccgo_ts + 1403 } else { - v7 = __ccgo_ts + 1405 + v7 = __ccgo_ts + 1406 } Xsqlite3_str_append(tls, bp+48, v7, int32(2)) } case int32('R'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1408, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1409, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('s'): if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1418, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1419, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) } else { iS = (*(*TDateTime)(unsafe.Pointer(bp))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1423, libc.VaList(bp+184, iS)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1424, libc.VaList(bp+184, iS)) } case int32('S'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1349, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('T'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1428, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1429, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('u'): /* Day of week. 1 to 7. Monday==1, Sunday==7 */ fallthrough case int32('w'): /* Day of week. 0 to 6. Sunday==0, Monday==1 */ @@ -14803,18 +14987,18 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } Xsqlite3_str_appendchar(tls, bp+48, int32(1), c) case int32('U'): /* Week num. 00-53. First Sun of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1349, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) case int32('V'): /* Week num. 01-53. First week with a Thur is week 01 */ *(*TDateTime)(unsafe.Pointer(bp + 128)) = *(*TDateTime)(unsafe.Pointer(bp)) /* Adjust y so that is the Thursday in the same week as x */ (*(*TDateTime)(unsafe.Pointer(bp + 128))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 128))).FvalidYMD = uint8(0) _computeYMD(tls, bp+128) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1349, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) case int32('W'): /* Week num. 00-53. First Mon of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1349, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) case int32('Y'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1380, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1381, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) case int32('%'): Xsqlite3_str_appendchar(tls, bp+48, int32(1), uint8('%')) default: @@ -14970,7 +15154,7 @@ func _timediffFunc(tls *libc.TLS, context uintptr, NotUsed1 int32, argv uintptr) _clearYMD_HMS_TZ(tls, bp) _computeYMD_HMS(tls, bp) _sqlite3StrAccumInit(tls, bp+96, uintptr(0), uintptr(0), 0, int32(100)) - Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1443, libc.VaList(bp+136, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) + Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1444, libc.VaList(bp+136, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) _sqlite3ResultStrAccum(tls, context, bp+96) } @@ -15000,58 +15184,58 @@ func _sqlite3RegisterDateTimeFunctions(tls *libc.TLS) { var _aDateTimeFuncs = [10]TFuncDef{ 0: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1249, + FzName: __ccgo_ts + 1250, }, 1: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1269, + FzName: __ccgo_ts + 1270, }, 2: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1477, + FzName: __ccgo_ts + 1478, }, 3: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1482, + FzName: __ccgo_ts + 1483, }, 4: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1487, + FzName: __ccgo_ts + 1488, }, 5: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1496, + FzName: __ccgo_ts + 1497, }, 6: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1505, + FzName: __ccgo_ts + 1506, }, 7: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1514, + FzName: __ccgo_ts + 1515, }, 8: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1527, + FzName: __ccgo_ts + 1528, }, 9: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1545, + FzName: __ccgo_ts + 1546, }, } @@ -15722,7 +15906,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1558, libc.VaList(bp+8, nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1559, libc.VaList(bp+8, nByte)) } return p } @@ -15784,7 +15968,7 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1596, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1597, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) } return p } @@ -17152,7 +17336,7 @@ func _sqlite3OomFault(tls *libc.TLS, db uintptr) (r uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpParse != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1632, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1633, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) pParse = (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).FpOuterParse for { @@ -17574,7 +17758,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4))) c = v3 if v3 == 0 { - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1646, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1647, int32(1)) break } /* Find out what flags are present */ @@ -17989,9 +18173,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial != 0 { if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial) == int32(2) { if flag_zeropad != 0 { - v57 = __ccgo_ts + 1648 + v57 = __ccgo_ts + 1649 } else { - v57 = __ccgo_ts + 1653 + v57 = __ccgo_ts + 1654 } bufpt = v57 length = _sqlite3Strlen30(tls, bufpt) @@ -18002,7 +18186,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP = int32(1000) (*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fn = int32(1) } else { - libc.Xmemcpy(tls, bp, __ccgo_ts+1657, uint64(5)) + libc.Xmemcpy(tls, bp, __ccgo_ts+1658, uint64(5)) bufpt = bp if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { /* no-op */ @@ -18335,7 +18519,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bufpt = libc.VaUintptr(&ap) } if bufpt == uintptr(0) { - bufpt = __ccgo_ts + 1662 + bufpt = __ccgo_ts + 1663 } else { if libc.Int32FromUint8(xtype) == int32(etDYNSTRING) { if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { @@ -18423,9 +18607,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li isnull = libc.BoolInt32(escarg == uintptr(0)) if isnull != 0 { if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1663 + v98 = __ccgo_ts + 1664 } else { - v98 = __ccgo_ts + 1668 + v98 = __ccgo_ts + 1669 } escarg = v98 } @@ -18541,24 +18725,25 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias) } else { if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { - if (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0 { - Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1675, int32(1)) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { + Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1676, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { if (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 { Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias) } else { - pSel = (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect - /* Because of tag-20240424-1 */ - if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1677, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) - } else { - if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1687, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ + pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect + if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1678, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1708, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1688, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + } else { + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1709, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + } } } } @@ -18652,6 +18837,9 @@ func _sqlite3RecordErrorOffsetOfExpr(tls *libc.TLS, db uintptr, pExpr uintptr) { if pExpr == uintptr(0) { return } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) != uint32(0) { + return + } (*Tsqlite3)(unsafe.Pointer(db)).FerrByteOffset = *(*int32)(unsafe.Pointer(pExpr + 52)) } @@ -18838,7 +19026,7 @@ func _sqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) } else { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1662, 0, libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1663, 0, libc.UintptrFromInt32(0)) Xsqlite3_str_reset(tls, p) } } @@ -19926,7 +20114,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in c = uint32(*(*uint8)(unsafe.Pointer(v2))) if c >= uint32(0xc0) { c = uint32(_sqlite3Utf8Trans1[c-uint32(0xc0)]) - for zIn != zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { + for zIn < zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { v3 = zIn zIn++ c = c<<int32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3)))) @@ -19965,7 +20153,7 @@ func _sqlite3VdbeMemTranslate(tls *libc.TLS, pMem uintptr, desiredEnc Tu8) (r in c = uint32(*(*uint8)(unsafe.Pointer(v10))) if c >= uint32(0xc0) { c = uint32(_sqlite3Utf8Trans1[c-uint32(0xc0)]) - for zIn != zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { + for zIn < zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { v11 = zIn zIn++ c = c<<int32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v11)))) @@ -20247,23 +20435,25 @@ func _sqlite3Utf16to8(tls *libc.TLS, db uintptr, z uintptr, nByte int32, enc Tu8 // C documentation // // /* -// ** zIn is a UTF-16 encoded unicode string at least nChar characters long. +// ** zIn is a UTF-16 encoded unicode string at least nByte bytes long. // ** Return the number of bytes in the first nChar unicode characters -// ** in pZ. nChar must be non-negative. +// ** in pZ. nChar must be non-negative. Surrogate pairs count as a single +// ** character. // */ -func _sqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nChar int32) (r int32) { +func _sqlite3Utf16ByteLen(tls *libc.TLS, zIn uintptr, nByte int32, nChar int32) (r int32) { var c, n int32 - var z uintptr - _, _, _ = c, n, z + var z, zEnd uintptr + _, _, _, _ = c, n, z, zEnd z = zIn + zEnd = z + uintptr(nByte-int32(1)) n = 0 if true { z++ } - for n < nChar { + for n < nChar && z <= zEnd { c = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) z += uintptr(2) - if c >= int32(0xd8) && c < int32(0xdc) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) >= int32(0xdc) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) < int32(0xe0) { + if c >= int32(0xd8) && c < int32(0xdc) && z <= zEnd && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) >= int32(0xdc) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) < int32(0xe0) { z += uintptr(2) } n++ @@ -20679,7 +20869,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1722, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1723, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -20932,24 +21122,24 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { // ** returns FALSE but it still converts the prefix and writes the result // ** into *pResult. // */ -func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc Tu8) (r1 int32) { +func _sqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc Tu8) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var d, e, eType, eValid, esign, i, incr, nDigit, sign, v2 int32 - var r, v3, v4 float64 var s, s2 Tu64 var zEnd uintptr + var v3, v4 float64 var _ /* rr at bp+0 */ [2]float64 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = d, e, eType, eValid, esign, i, incr, nDigit, r, s, s2, sign, zEnd, v2, v3, v4 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = d, e, eType, eValid, esign, i, incr, nDigit, s, s2, sign, zEnd, v2, v3, v4 /* sign * significand * (10 ^ (esign * exponent)) */ - sign = int32(1) /* sign of significand */ - s = uint64(0) /* significand */ - d = 0 /* adjust exponent for shifting decimal point */ - esign = int32(1) /* sign of exponent */ - e = 0 /* exponent */ - eValid = int32(1) /* True exponent is either not used or is well-formed */ - nDigit = 0 /* Number of digits processed */ - eType = int32(1) /* 1: pure integer, 2+: fractional -1 or less: bad UTF16 */ + sign = int32(1) /* sign of significand */ + s = uint64(0) /* significand */ + d = 0 /* adjust exponent for shifting decimal point */ + esign = int32(1) /* sign of exponent */ + e = 0 /* exponent */ + eValid = int32(1) /* True exponent is either not used or is well-formed */ + nDigit = 0 /* Number of digits processed */ + eType = int32(1) *(*float64)(unsafe.Pointer(pResult)) = float64(0) /* Default return value, in case of an error */ if length == 0 { return 0 @@ -21079,7 +21269,7 @@ do_atof_calc: /* adjust exponent by d, and update sign */ e = e*esign + d /* Try to adjust the exponent to make it smaller */ - for e > 0 && s < (libc.Uint64FromUint32(0xffffffff)|libc.Uint64FromUint32(0xffffffff)<<libc.Int32FromInt32(32))/libc.Uint64FromInt32(10) { + for e > 0 && s < (libc.Uint64FromUint32(0xffffffff)|libc.Uint64FromUint32(0xffffffff)<<libc.Int32FromInt32(32)-libc.Uint64FromInt32(0x7ff))/libc.Uint64FromInt32(10) { s *= uint64(10) e-- } @@ -21087,85 +21277,52 @@ do_atof_calc: s /= uint64(10) e++ } - if e == 0 { - *(*float64)(unsafe.Pointer(pResult)) = float64(s) - } else { - if _sqlite3Config.FbUseLongDouble != 0 { - r = float64(s) - if e > 0 { - for e >= int32(100) { - e -= int32(100) - r = r * libc.Float64FromFloat64(1e+100) - } - for e >= int32(10) { - e -= int32(10) - r = r * libc.Float64FromFloat64(1e+10) - } - for e >= int32(1) { - e -= int32(1) - r = r * libc.Float64FromFloat64(10) - } - } else { - for e <= -int32(100) { - e += int32(100) - r = r * libc.Float64FromFloat64(1e-100) - } - for e <= -int32(10) { - e += int32(10) - r = r * libc.Float64FromFloat64(1e-10) - } - for e <= -int32(1) { - e += int32(1) - r = r * libc.Float64FromFloat64(0.1) - } - } - if r > +libc.Float64FromFloat64(1.7976931348623157081452742373e+308) { - *(*float64)(unsafe.Pointer(pResult)) = float64(+libc.X__builtin_inff(tls)) - } else { - *(*float64)(unsafe.Pointer(pResult)) = r - } + (*(*[2]float64)(unsafe.Pointer(bp)))[0] = float64(s) + /* Largest double that can be safely converted to u64 + ** vvvvvvvvvvvvvvvvvvvvvv */ + if (*(*[2]float64)(unsafe.Pointer(bp)))[0] <= float64(1.844674407370955e+19) { + s2 = uint64((*(*[2]float64)(unsafe.Pointer(bp)))[0]) + if s >= s2 { + v4 = float64(s - s2) } else { - (*(*[2]float64)(unsafe.Pointer(bp)))[0] = float64(s) - s2 = uint64((*(*[2]float64)(unsafe.Pointer(bp)))[0]) - if s >= s2 { - v4 = float64(s - s2) - } else { - v4 = -float64(s2 - s) - } - (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] = v4 - if e > 0 { - for e >= int32(100) { - e -= int32(100) - _dekkerMul2(tls, bp, float64(1e+100), -libc.Float64FromFloat64(1.5902891109759918e+83)) - } - for e >= int32(10) { - e -= int32(10) - _dekkerMul2(tls, bp, float64(1e+10), float64(0)) - } - for e >= int32(1) { - e -= int32(1) - _dekkerMul2(tls, bp, float64(10), float64(0)) - } - } else { - for e <= -int32(100) { - e += int32(100) - _dekkerMul2(tls, bp, float64(1e-100), -libc.Float64FromFloat64(1.9991899802602883e-117)) - } - for e <= -int32(10) { - e += int32(10) - _dekkerMul2(tls, bp, float64(1e-10), -libc.Float64FromFloat64(3.643219731549774e-27)) - } - for e <= -int32(1) { - e += int32(1) - _dekkerMul2(tls, bp, float64(0.1), -libc.Float64FromFloat64(5.551115123125783e-18)) - } - } - *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] - if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) - } + v4 = -float64(s2 - s) + } + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] = v4 + } else { + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] = float64(0) + } + /* Equal only when rr[0]==0.0 */ + if e > 0 { + for e >= int32(100) { + e -= int32(100) + _dekkerMul2(tls, bp, float64(1e+100), -libc.Float64FromFloat64(1.5902891109759918e+83)) + } + for e >= int32(10) { + e -= int32(10) + _dekkerMul2(tls, bp, float64(1e+10), float64(0)) + } + for e >= int32(1) { + e -= int32(1) + _dekkerMul2(tls, bp, float64(10), float64(0)) + } + } else { + for e <= -int32(100) { + e += int32(100) + _dekkerMul2(tls, bp, float64(1e-100), -libc.Float64FromFloat64(1.9991899802602883e-117)) + } + for e <= -int32(10) { + e += int32(10) + _dekkerMul2(tls, bp, float64(1e-10), -libc.Float64FromFloat64(3.643219731549774e-27)) + } + for e <= -int32(1) { + e += int32(1) + _dekkerMul2(tls, bp, float64(0.1), -libc.Float64FromFloat64(5.551115123125783e-18)) } } + *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] + if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { + *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) } @@ -21182,7 +21339,7 @@ atof_return: return 0 } } - return r1 + return r } // C documentation @@ -21254,7 +21411,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1747 + pow63 = __ccgo_ts + 1748 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -21481,7 +21638,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1766)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1767)) if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -21605,10 +21762,13 @@ func _sqlite3Atoi(tls *libc.TLS, z uintptr) (r int32) { // ** Decode a floating-point value into an approximate decimal // ** representation. // ** -// ** Round the decimal representation to n significant digits if -// ** n is positive. Or round to -n signficant digits after the -// ** decimal point if n is negative. No rounding is performed if -// ** n is zero. +// ** If iRound<=0 then round to -iRound significant digits to the +// ** the left of the decimal point, or to a maximum of mxRound total +// ** significant digits. +// ** +// ** If iRound>0 round to min(iRound,mxRound) significant digits total. +// ** +// ** mxRound must be positive. // ** // ** The significant digits of the decimal representation are // ** stored in p->z[] which is a often (but not always) a pointer @@ -21620,12 +21780,11 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun defer tls.Free(32) *(*float64)(unsafe.Pointer(bp)) = _r var e, exp, i, j, v2, v3, v4 int32 - var rr float64 var z uintptr var v1 uint64 var _ /* rr at bp+16 */ [2]float64 var _ /* v at bp+8 */ Tu64 - _, _, _, _, _, _, _, _, _, _ = e, exp, i, j, rr, z, v1, v2, v3, v4 + _, _, _, _, _, _, _, _, _ = e, exp, i, j, z, v1, v2, v3, v4 exp = 0 (*TFpDecode)(unsafe.Pointer(p)).FisSpecial = uint8(0) (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 @@ -21639,7 +21798,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1782 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1783 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -21655,74 +21814,50 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } /* Multiply r by powers of ten until it lands somewhere in between ** 1.0e+19 and 1.0e+17. + ** + ** Use Dekker-style double-double computation to increase the + ** precision. + ** + ** The error terms on constants like 1.0e+100 computed using the + ** decimal extension, for example as follows: + ** + ** SELECT decimal_exp(decimal_sub('1.0e+100',decimal(1.0e+100))); */ - if _sqlite3Config.FbUseLongDouble != 0 { - rr = *(*float64)(unsafe.Pointer(bp)) - if rr >= float64(1e+19) { - for rr >= libc.Float64FromFloat64(1e+119) { - exp += int32(100) - rr = rr * libc.Float64FromFloat64(1e-100) - } - for rr >= libc.Float64FromFloat64(1e+29) { - exp += int32(10) - rr = rr * libc.Float64FromFloat64(1e-10) - } - for rr >= libc.Float64FromFloat64(1e+19) { - exp++ - rr = rr * libc.Float64FromFloat64(0.1) - } - } else { - for rr < libc.Float64FromFloat64(1e-97) { - exp -= int32(100) - rr = rr * libc.Float64FromFloat64(1e+100) - } - for rr < libc.Float64FromFloat64(1e+07) { - exp -= int32(10) - rr = rr * libc.Float64FromFloat64(1e+10) - } - for rr < libc.Float64FromFloat64(1e+17) { - exp-- - rr = rr * libc.Float64FromFloat64(10) - } + (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] = *(*float64)(unsafe.Pointer(bp)) + (*(*[2]float64)(unsafe.Pointer(bp + 16)))[int32(1)] = float64(0) + if (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] > float64(9.223372036854775e+18) { + for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] > float64(9.223372036854774e+118) { + exp += int32(100) + _dekkerMul2(tls, bp+16, float64(1e-100), -libc.Float64FromFloat64(1.9991899802602883e-117)) + } + for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] > float64(9.223372036854774e+28) { + exp += int32(10) + _dekkerMul2(tls, bp+16, float64(1e-10), -libc.Float64FromFloat64(3.643219731549774e-27)) + } + for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] > float64(9.223372036854775e+18) { + exp += int32(1) + _dekkerMul2(tls, bp+16, float64(0.1), -libc.Float64FromFloat64(5.551115123125783e-18)) } - *(*Tu64)(unsafe.Pointer(bp + 8)) = uint64(rr) } else { - (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] = *(*float64)(unsafe.Pointer(bp)) - (*(*[2]float64)(unsafe.Pointer(bp + 16)))[int32(1)] = float64(0) - if (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] > float64(9.223372036854775e+18) { - for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] > float64(9.223372036854774e+118) { - exp += int32(100) - _dekkerMul2(tls, bp+16, float64(1e-100), -libc.Float64FromFloat64(1.9991899802602883e-117)) - } - for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] > float64(9.223372036854774e+28) { - exp += int32(10) - _dekkerMul2(tls, bp+16, float64(1e-10), -libc.Float64FromFloat64(3.643219731549774e-27)) - } - for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] > float64(9.223372036854775e+18) { - exp += int32(1) - _dekkerMul2(tls, bp+16, float64(0.1), -libc.Float64FromFloat64(5.551115123125783e-18)) - } - } else { - for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] < float64(9.223372036854775e-83) { - exp -= int32(100) - _dekkerMul2(tls, bp+16, float64(1e+100), -libc.Float64FromFloat64(1.5902891109759918e+83)) - } - for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] < float64(9.223372036854775e+07) { - exp -= int32(10) - _dekkerMul2(tls, bp+16, float64(1e+10), float64(0)) - } - for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] < float64(9.223372036854775e+17) { - exp -= int32(1) - _dekkerMul2(tls, bp+16, float64(10), float64(0)) - } + for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] < float64(9.223372036854775e-83) { + exp -= int32(100) + _dekkerMul2(tls, bp+16, float64(1e+100), -libc.Float64FromFloat64(1.5902891109759918e+83)) } - if (*(*[2]float64)(unsafe.Pointer(bp + 16)))[int32(1)] < float64(0) { - v1 = uint64((*(*[2]float64)(unsafe.Pointer(bp + 16)))[0]) - uint64(-(*(*[2]float64)(unsafe.Pointer(bp + 16)))[int32(1)]) - } else { - v1 = uint64((*(*[2]float64)(unsafe.Pointer(bp + 16)))[0]) + uint64((*(*[2]float64)(unsafe.Pointer(bp + 16)))[int32(1)]) + for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] < float64(9.223372036854775e+07) { + exp -= int32(10) + _dekkerMul2(tls, bp+16, float64(1e+10), float64(0)) } - *(*Tu64)(unsafe.Pointer(bp + 8)) = v1 + for (*(*[2]float64)(unsafe.Pointer(bp + 16)))[0] < float64(9.223372036854775e+17) { + exp -= int32(1) + _dekkerMul2(tls, bp+16, float64(10), float64(0)) + } + } + if (*(*[2]float64)(unsafe.Pointer(bp + 16)))[int32(1)] < float64(0) { + v1 = uint64((*(*[2]float64)(unsafe.Pointer(bp + 16)))[0]) - uint64(-(*(*[2]float64)(unsafe.Pointer(bp + 16)))[int32(1)]) + } else { + v1 = uint64((*(*[2]float64)(unsafe.Pointer(bp + 16)))[0]) + uint64((*(*[2]float64)(unsafe.Pointer(bp + 16)))[int32(1)]) } + *(*Tu64)(unsafe.Pointer(bp + 8)) = v1 /* Extract significant digits. */ i = libc.Int32FromUint64(libc.Uint64FromInt64(24) - libc.Uint64FromInt32(1)) for *(*Tu64)(unsafe.Pointer(bp + 8)) != 0 { @@ -22188,7 +22323,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1784, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1785, libc.VaList(bp+8, zType)) } // C documentation @@ -22211,13 +22346,13 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { var eOpenState Tu8 _ = eOpenState if db == uintptr(0) { - _logBadConnection(tls, __ccgo_ts+1663) + _logBadConnection(tls, __ccgo_ts+1664) return 0 } eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1829) + _logBadConnection(tls, __ccgo_ts+1830) } return 0 } else { @@ -22231,7 +22366,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1838) + _logBadConnection(tls, __ccgo_ts+1839) return 0 } else { return int32(1) @@ -22552,10 +22687,6 @@ func _sqlite3VListNameToNum(tls *libc.TLS, pIn uintptr, zName uintptr, nName int return 0 } -/* -** High-resolution hardware timer used for debugging and testing only. - */ - /************** End of util.c ************************************************/ /************** Begin file hash.c ********************************************/ /* @@ -22877,196 +23008,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1846, - 1: __ccgo_ts + 1856, - 2: __ccgo_ts + 1867, - 3: __ccgo_ts + 1879, - 4: __ccgo_ts + 1890, - 5: __ccgo_ts + 1902, - 6: __ccgo_ts + 1909, - 7: __ccgo_ts + 1917, - 8: __ccgo_ts + 1925, - 9: __ccgo_ts + 1930, - 10: __ccgo_ts + 1935, - 11: __ccgo_ts + 1941, - 12: __ccgo_ts + 1955, - 13: __ccgo_ts + 1961, - 14: __ccgo_ts + 1971, - 15: __ccgo_ts + 1976, - 16: __ccgo_ts + 1981, - 17: __ccgo_ts + 1984, - 18: __ccgo_ts + 1990, - 19: __ccgo_ts + 1997, - 20: __ccgo_ts + 2001, - 21: __ccgo_ts + 2011, - 22: __ccgo_ts + 2018, - 23: __ccgo_ts + 2025, - 24: __ccgo_ts + 2032, - 25: __ccgo_ts + 2039, - 26: __ccgo_ts + 2049, - 27: __ccgo_ts + 2058, - 28: __ccgo_ts + 2069, - 29: __ccgo_ts + 2078, - 30: __ccgo_ts + 2084, - 31: __ccgo_ts + 2094, - 32: __ccgo_ts + 2104, - 33: __ccgo_ts + 2109, - 34: __ccgo_ts + 2123, - 35: __ccgo_ts + 2134, - 36: __ccgo_ts + 2139, - 37: __ccgo_ts + 2146, - 38: __ccgo_ts + 2157, - 39: __ccgo_ts + 2162, - 40: __ccgo_ts + 2167, - 41: __ccgo_ts + 2173, - 42: __ccgo_ts + 2179, - 43: __ccgo_ts + 2185, - 44: __ccgo_ts + 2188, - 45: __ccgo_ts + 2192, - 46: __ccgo_ts + 2198, - 47: __ccgo_ts + 2209, - 48: __ccgo_ts + 2220, - 49: __ccgo_ts + 2228, - 50: __ccgo_ts + 2237, + 0: __ccgo_ts + 1847, + 1: __ccgo_ts + 1857, + 2: __ccgo_ts + 1868, + 3: __ccgo_ts + 1880, + 4: __ccgo_ts + 1891, + 5: __ccgo_ts + 1903, + 6: __ccgo_ts + 1910, + 7: __ccgo_ts + 1918, + 8: __ccgo_ts + 1926, + 9: __ccgo_ts + 1931, + 10: __ccgo_ts + 1936, + 11: __ccgo_ts + 1942, + 12: __ccgo_ts + 1956, + 13: __ccgo_ts + 1962, + 14: __ccgo_ts + 1972, + 15: __ccgo_ts + 1977, + 16: __ccgo_ts + 1982, + 17: __ccgo_ts + 1985, + 18: __ccgo_ts + 1991, + 19: __ccgo_ts + 1998, + 20: __ccgo_ts + 2002, + 21: __ccgo_ts + 2012, + 22: __ccgo_ts + 2019, + 23: __ccgo_ts + 2026, + 24: __ccgo_ts + 2033, + 25: __ccgo_ts + 2040, + 26: __ccgo_ts + 2050, + 27: __ccgo_ts + 2059, + 28: __ccgo_ts + 2070, + 29: __ccgo_ts + 2079, + 30: __ccgo_ts + 2085, + 31: __ccgo_ts + 2095, + 32: __ccgo_ts + 2105, + 33: __ccgo_ts + 2110, + 34: __ccgo_ts + 2124, + 35: __ccgo_ts + 2135, + 36: __ccgo_ts + 2140, + 37: __ccgo_ts + 2147, + 38: __ccgo_ts + 2158, + 39: __ccgo_ts + 2163, + 40: __ccgo_ts + 2168, + 41: __ccgo_ts + 2174, + 42: __ccgo_ts + 2180, + 43: __ccgo_ts + 2186, + 44: __ccgo_ts + 2189, + 45: __ccgo_ts + 2193, + 46: __ccgo_ts + 2199, + 47: __ccgo_ts + 2210, + 48: __ccgo_ts + 2221, + 49: __ccgo_ts + 2229, + 50: __ccgo_ts + 2238, 51: __ccgo_ts + 2244, - 52: __ccgo_ts + 2252, - 53: __ccgo_ts + 2255, - 54: __ccgo_ts + 2258, - 55: __ccgo_ts + 2261, - 56: __ccgo_ts + 2264, - 57: __ccgo_ts + 2267, - 58: __ccgo_ts + 2270, + 52: __ccgo_ts + 2251, + 53: __ccgo_ts + 2259, + 54: __ccgo_ts + 2262, + 55: __ccgo_ts + 2265, + 56: __ccgo_ts + 2268, + 57: __ccgo_ts + 2271, + 58: __ccgo_ts + 2274, 59: __ccgo_ts + 2277, - 60: __ccgo_ts + 2283, - 61: __ccgo_ts + 2293, - 62: __ccgo_ts + 2306, - 63: __ccgo_ts + 2317, - 64: __ccgo_ts + 2323, - 65: __ccgo_ts + 2330, - 66: __ccgo_ts + 2339, - 67: __ccgo_ts + 2348, - 68: __ccgo_ts + 2355, - 69: __ccgo_ts + 2368, - 70: __ccgo_ts + 2379, - 71: __ccgo_ts + 2384, - 72: __ccgo_ts + 2392, - 73: __ccgo_ts + 2398, - 74: __ccgo_ts + 2405, - 75: __ccgo_ts + 2417, - 76: __ccgo_ts + 2422, - 77: __ccgo_ts + 2431, - 78: __ccgo_ts + 2436, - 79: __ccgo_ts + 2445, - 80: __ccgo_ts + 2450, - 81: __ccgo_ts + 2455, - 82: __ccgo_ts + 2461, - 83: __ccgo_ts + 2469, - 84: __ccgo_ts + 2477, - 85: __ccgo_ts + 2487, - 86: __ccgo_ts + 2495, - 87: __ccgo_ts + 2502, - 88: __ccgo_ts + 2515, - 89: __ccgo_ts + 2520, - 90: __ccgo_ts + 2532, - 91: __ccgo_ts + 2540, - 92: __ccgo_ts + 2547, - 93: __ccgo_ts + 2558, - 94: __ccgo_ts + 2565, - 95: __ccgo_ts + 2572, - 96: __ccgo_ts + 2582, - 97: __ccgo_ts + 2591, - 98: __ccgo_ts + 2602, - 99: __ccgo_ts + 2608, - 100: __ccgo_ts + 2619, - 101: __ccgo_ts + 2629, - 102: __ccgo_ts + 2639, - 103: __ccgo_ts + 2646, - 104: __ccgo_ts + 2652, + 60: __ccgo_ts + 2284, + 61: __ccgo_ts + 2294, + 62: __ccgo_ts + 2307, + 63: __ccgo_ts + 2318, + 64: __ccgo_ts + 2324, + 65: __ccgo_ts + 2331, + 66: __ccgo_ts + 2340, + 67: __ccgo_ts + 2349, + 68: __ccgo_ts + 2356, + 69: __ccgo_ts + 2369, + 70: __ccgo_ts + 2380, + 71: __ccgo_ts + 2385, + 72: __ccgo_ts + 2393, + 73: __ccgo_ts + 2399, + 74: __ccgo_ts + 2406, + 75: __ccgo_ts + 2418, + 76: __ccgo_ts + 2423, + 77: __ccgo_ts + 2432, + 78: __ccgo_ts + 2437, + 79: __ccgo_ts + 2446, + 80: __ccgo_ts + 2451, + 81: __ccgo_ts + 2456, + 82: __ccgo_ts + 2462, + 83: __ccgo_ts + 2470, + 84: __ccgo_ts + 2478, + 85: __ccgo_ts + 2488, + 86: __ccgo_ts + 2496, + 87: __ccgo_ts + 2503, + 88: __ccgo_ts + 2516, + 89: __ccgo_ts + 2521, + 90: __ccgo_ts + 2533, + 91: __ccgo_ts + 2541, + 92: __ccgo_ts + 2548, + 93: __ccgo_ts + 2559, + 94: __ccgo_ts + 2566, + 95: __ccgo_ts + 2573, + 96: __ccgo_ts + 2583, + 97: __ccgo_ts + 2592, + 98: __ccgo_ts + 2603, + 99: __ccgo_ts + 2609, + 100: __ccgo_ts + 2620, + 101: __ccgo_ts + 2630, + 102: __ccgo_ts + 2640, + 103: __ccgo_ts + 2649, + 104: __ccgo_ts + 2656, 105: __ccgo_ts + 2662, - 106: __ccgo_ts + 2673, - 107: __ccgo_ts + 2677, - 108: __ccgo_ts + 2686, - 109: __ccgo_ts + 2695, - 110: __ccgo_ts + 2702, + 106: __ccgo_ts + 2672, + 107: __ccgo_ts + 2683, + 108: __ccgo_ts + 2687, + 109: __ccgo_ts + 2696, + 110: __ccgo_ts + 2705, 111: __ccgo_ts + 2712, - 112: __ccgo_ts + 2719, - 113: __ccgo_ts + 2728, - 114: __ccgo_ts + 2738, - 115: __ccgo_ts + 2745, - 116: __ccgo_ts + 2753, - 117: __ccgo_ts + 2767, - 118: __ccgo_ts + 2775, - 119: __ccgo_ts + 2789, - 120: __ccgo_ts + 2800, - 121: __ccgo_ts + 2813, - 122: __ccgo_ts + 2824, - 123: __ccgo_ts + 2830, - 124: __ccgo_ts + 2842, - 125: __ccgo_ts + 2851, - 126: __ccgo_ts + 2859, - 127: __ccgo_ts + 2868, - 128: __ccgo_ts + 2877, - 129: __ccgo_ts + 2884, - 130: __ccgo_ts + 2892, - 131: __ccgo_ts + 2899, - 132: __ccgo_ts + 2910, - 133: __ccgo_ts + 2924, - 134: __ccgo_ts + 2935, - 135: __ccgo_ts + 2943, - 136: __ccgo_ts + 2949, - 137: __ccgo_ts + 2957, - 138: __ccgo_ts + 2965, - 139: __ccgo_ts + 2975, - 140: __ccgo_ts + 2988, - 141: __ccgo_ts + 2998, - 142: __ccgo_ts + 3011, - 143: __ccgo_ts + 3020, - 144: __ccgo_ts + 3031, - 145: __ccgo_ts + 3039, - 146: __ccgo_ts + 3045, - 147: __ccgo_ts + 3057, - 148: __ccgo_ts + 3069, - 149: __ccgo_ts + 3077, - 150: __ccgo_ts + 3089, - 151: __ccgo_ts + 3102, - 152: __ccgo_ts + 3112, - 153: __ccgo_ts + 3122, - 154: __ccgo_ts + 3127, - 155: __ccgo_ts + 3139, - 156: __ccgo_ts + 3151, - 157: __ccgo_ts + 3161, - 158: __ccgo_ts + 3167, - 159: __ccgo_ts + 3177, - 160: __ccgo_ts + 3184, - 161: __ccgo_ts + 3196, - 162: __ccgo_ts + 3207, - 163: __ccgo_ts + 3215, - 164: __ccgo_ts + 3224, - 165: __ccgo_ts + 3233, - 166: __ccgo_ts + 3242, - 167: __ccgo_ts + 3249, - 168: __ccgo_ts + 3260, - 169: __ccgo_ts + 3273, - 170: __ccgo_ts + 3283, - 171: __ccgo_ts + 3290, - 172: __ccgo_ts + 3298, - 173: __ccgo_ts + 3307, - 174: __ccgo_ts + 3313, - 175: __ccgo_ts + 3320, - 176: __ccgo_ts + 3328, - 177: __ccgo_ts + 3336, - 178: __ccgo_ts + 3344, - 179: __ccgo_ts + 3354, - 180: __ccgo_ts + 3363, - 181: __ccgo_ts + 3374, - 182: __ccgo_ts + 3385, - 183: __ccgo_ts + 3396, - 184: __ccgo_ts + 3406, - 185: __ccgo_ts + 3412, - 186: __ccgo_ts + 3423, - 187: __ccgo_ts + 3434, - 188: __ccgo_ts + 3439, - 189: __ccgo_ts + 3447, + 112: __ccgo_ts + 2722, + 113: __ccgo_ts + 2729, + 114: __ccgo_ts + 2739, + 115: __ccgo_ts + 2747, + 116: __ccgo_ts + 2754, + 117: __ccgo_ts + 2768, + 118: __ccgo_ts + 2782, + 119: __ccgo_ts + 2790, + 120: __ccgo_ts + 2801, + 121: __ccgo_ts + 2814, + 122: __ccgo_ts + 2825, + 123: __ccgo_ts + 2831, + 124: __ccgo_ts + 2843, + 125: __ccgo_ts + 2852, + 126: __ccgo_ts + 2860, + 127: __ccgo_ts + 2869, + 128: __ccgo_ts + 2878, + 129: __ccgo_ts + 2885, + 130: __ccgo_ts + 2893, + 131: __ccgo_ts + 2900, + 132: __ccgo_ts + 2911, + 133: __ccgo_ts + 2925, + 134: __ccgo_ts + 2936, + 135: __ccgo_ts + 2944, + 136: __ccgo_ts + 2950, + 137: __ccgo_ts + 2958, + 138: __ccgo_ts + 2966, + 139: __ccgo_ts + 2976, + 140: __ccgo_ts + 2989, + 141: __ccgo_ts + 2999, + 142: __ccgo_ts + 3012, + 143: __ccgo_ts + 3021, + 144: __ccgo_ts + 3032, + 145: __ccgo_ts + 3040, + 146: __ccgo_ts + 3046, + 147: __ccgo_ts + 3058, + 148: __ccgo_ts + 3070, + 149: __ccgo_ts + 3078, + 150: __ccgo_ts + 3090, + 151: __ccgo_ts + 3103, + 152: __ccgo_ts + 3113, + 153: __ccgo_ts + 3123, + 154: __ccgo_ts + 3135, + 155: __ccgo_ts + 3140, + 156: __ccgo_ts + 3152, + 157: __ccgo_ts + 3162, + 158: __ccgo_ts + 3168, + 159: __ccgo_ts + 3178, + 160: __ccgo_ts + 3185, + 161: __ccgo_ts + 3197, + 162: __ccgo_ts + 3208, + 163: __ccgo_ts + 3216, + 164: __ccgo_ts + 3225, + 165: __ccgo_ts + 3234, + 166: __ccgo_ts + 3243, + 167: __ccgo_ts + 3250, + 168: __ccgo_ts + 3261, + 169: __ccgo_ts + 3274, + 170: __ccgo_ts + 3284, + 171: __ccgo_ts + 3291, + 172: __ccgo_ts + 3299, + 173: __ccgo_ts + 3308, + 174: __ccgo_ts + 3314, + 175: __ccgo_ts + 3321, + 176: __ccgo_ts + 3329, + 177: __ccgo_ts + 3337, + 178: __ccgo_ts + 3345, + 179: __ccgo_ts + 3355, + 180: __ccgo_ts + 3364, + 181: __ccgo_ts + 3375, + 182: __ccgo_ts + 3386, + 183: __ccgo_ts + 3397, + 184: __ccgo_ts + 3407, + 185: __ccgo_ts + 3413, + 186: __ccgo_ts + 3424, + 187: __ccgo_ts + 3435, + 188: __ccgo_ts + 3440, + 189: __ccgo_ts + 3448, } type Tblksize_t = int32 @@ -23701,91 +23832,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3457, + FzName: __ccgo_ts + 3458, }, 1: { - FzName: __ccgo_ts + 3462, + FzName: __ccgo_ts + 3463, }, 2: { - FzName: __ccgo_ts + 3468, + FzName: __ccgo_ts + 3469, }, 3: { - FzName: __ccgo_ts + 3475, + FzName: __ccgo_ts + 3476, }, 4: { - FzName: __ccgo_ts + 3482, + FzName: __ccgo_ts + 3483, }, 5: { - FzName: __ccgo_ts + 3487, + FzName: __ccgo_ts + 3488, }, 6: { - FzName: __ccgo_ts + 3493, + FzName: __ccgo_ts + 3494, }, 7: { - FzName: __ccgo_ts + 3503, + FzName: __ccgo_ts + 3504, }, 8: { - FzName: __ccgo_ts + 3509, + FzName: __ccgo_ts + 3510, }, 9: { - FzName: __ccgo_ts + 3514, + FzName: __ccgo_ts + 3515, }, 10: { - FzName: __ccgo_ts + 3520, + FzName: __ccgo_ts + 3521, }, 11: { - FzName: __ccgo_ts + 3528, + FzName: __ccgo_ts + 3529, }, 12: { - FzName: __ccgo_ts + 3534, + FzName: __ccgo_ts + 3535, }, 13: { - FzName: __ccgo_ts + 3541, + FzName: __ccgo_ts + 3542, }, 14: { - FzName: __ccgo_ts + 3550, + FzName: __ccgo_ts + 3551, }, 15: { - FzName: __ccgo_ts + 3557, + FzName: __ccgo_ts + 3558, }, 16: { - FzName: __ccgo_ts + 3567, + FzName: __ccgo_ts + 3568, }, 17: { - FzName: __ccgo_ts + 3574, + FzName: __ccgo_ts + 3575, }, 18: { - FzName: __ccgo_ts + 3588, + FzName: __ccgo_ts + 3589, }, 19: { - FzName: __ccgo_ts + 3594, + FzName: __ccgo_ts + 3595, }, 20: { - FzName: __ccgo_ts + 3600, + FzName: __ccgo_ts + 3601, }, 21: { - FzName: __ccgo_ts + 3607, + FzName: __ccgo_ts + 3608, }, 22: { - FzName: __ccgo_ts + 3615, + FzName: __ccgo_ts + 3616, }, 23: { - FzName: __ccgo_ts + 3620, + FzName: __ccgo_ts + 3621, }, 24: { - FzName: __ccgo_ts + 3627, + FzName: __ccgo_ts + 3628, }, 25: { - FzName: __ccgo_ts + 3634, + FzName: __ccgo_ts + 3635, }, 26: { - FzName: __ccgo_ts + 3646, + FzName: __ccgo_ts + 3647, }, 27: { - FzName: __ccgo_ts + 3655, + FzName: __ccgo_ts + 3656, }, 28: { - FzName: __ccgo_ts + 3661, + FzName: __ccgo_ts + 3662, }, } @@ -24024,9 +24155,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3667, libc.VaList(bp+136, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3668, libc.VaList(bp+136, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3710, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3711, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -24342,11 +24473,11 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint ** equivalent to errno. Otherwise, use strerror_r(). */ /* This is a threadsafe build, but strerror_r() is not available. */ - zErr = __ccgo_ts + 1662 + zErr = __ccgo_ts + 1663 if zPath == uintptr(0) { - zPath = __ccgo_ts + 1662 + zPath = __ccgo_ts + 1663 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3720, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3721, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -24374,7 +24505,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)<<libc.Int32FromInt32(8), __ccgo_ts+3462, v1, lineno) + _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)<<libc.Int32FromInt32(8), __ccgo_ts+3463, v1, lineno) } } @@ -24403,7 +24534,7 @@ func _closePendingFds(tls *libc.TLS, pFile uintptr) { break } pNext = (*TUnixUnusedFd)(unsafe.Pointer(p)).FpNext - _robust_close(tls, pFile, (*TUnixUnusedFd)(unsafe.Pointer(p)).Ffd, int32(39721)) + _robust_close(tls, pFile, (*TUnixUnusedFd)(unsafe.Pointer(p)).Ffd, int32(39959)) Xsqlite3_free(tls, p) goto _1 _1: @@ -24544,19 +24675,19 @@ func _verifyDbFile(tls *libc.TLS, pFile uintptr) { } rc = (*(*func(*libc.TLS, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(5)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, bp) if rc != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3751, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3752, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if (*(*Tstat)(unsafe.Pointer(bp))).Fst_nlink == uint32(0) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3775, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3776, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if (*(*Tstat)(unsafe.Pointer(bp))).Fst_nlink > uint32(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3804, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3805, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3831, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3832, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -24650,6 +24781,7 @@ func _unixFileLock(tls *libc.TLS, pFile uintptr, pLock uintptr) (r int32) { pInode = (*TunixFile)(unsafe.Pointer(pFile)).FpInode if libc.Int32FromUint16((*TunixFile)(unsafe.Pointer(pFile)).FctrlFlags)&(libc.Int32FromInt32(UNIXFILE_EXCL)|libc.Int32FromInt32(UNIXFILE_RDONLY)) == int32(UNIXFILE_EXCL) { if libc.Int32FromUint8((*TunixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 { + /* assert( pInode->nLock==0 ); <-- Not true if unix-excl READONLY used */ (*(*Tflock)(unsafe.Pointer(bp))).Fl_whence = 0 (*(*Tflock)(unsafe.Pointer(bp))).Fl_start = int64(_sqlite3PendingByte + libc.Int32FromInt32(2)) (*(*Tflock)(unsafe.Pointer(bp))).Fl_len = int64(SHARED_SIZE) @@ -25032,7 +25164,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40505)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25155,24 +25287,21 @@ func _nolockClose(tls *libc.TLS, id uintptr) (r int32) { // // /* // ** This routine checks if there is a RESERVED lock held on the specified -// ** file by this or any other process. If such a lock is held, set *pResOut -// ** to a non-zero value otherwise *pResOut is set to zero. The return value -// ** is set to SQLITE_OK unless an I/O error occurs during lock checking. -// ** -// ** In dotfile locking, either a lock exists or it does not. So in this -// ** variation of CheckReservedLock(), *pResOut is set to true if any lock -// ** is held on the file and false if the file is unlocked. +// ** file by this or any other process. If the caller holds a SHARED +// ** or greater lock when it is called, then it is assumed that no other +// ** client may hold RESERVED. Or, if the caller holds no lock, then it +// ** is assumed another client holds RESERVED if the lock-file exists. // */ func _dotlockCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { var pFile uintptr - var rc, reserved int32 - _, _, _ = pFile, rc, reserved - rc = SQLITE_OK - reserved = 0 + _ = pFile pFile = id - reserved = libc.BoolInt32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext, 0) == 0) - *(*int32)(unsafe.Pointer(pResOut)) = reserved - return rc + if libc.Int32FromUint8((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) >= int32(SHARED_LOCK) { + *(*int32)(unsafe.Pointer(pResOut)) = 0 + } else { + *(*int32)(unsafe.Pointer(pResOut)) = libc.BoolInt32((*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext, 0) == 0) + } + return SQLITE_OK } // C documentation @@ -25640,7 +25769,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]uint8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3859, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3860, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint64(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && libc.Int32FromUint8((*(*[513]uint8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -25666,7 +25795,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42111)), __ccgo_ts+3574, bp, int32(42111)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3575, bp, int32(42324)) } // C documentation @@ -25703,7 +25832,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<<libc.Int32FromInt32(8), __ccgo_ts+3862, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, int32(42152)) + return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<<libc.Int32FromInt32(8), __ccgo_ts+3863, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, int32(42365)) } /* Also fsync the directory containing the file if the DIRSYNC flag ** is set. This is a one-time occurrence. Many systems (examples: AIX) @@ -25713,7 +25842,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(17)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, bp) if rc == SQLITE_OK { _full_fsync(tls, *(*int32)(unsafe.Pointer(bp)), 0, 0) - _robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp)), int32(42166)) + _robust_close(tls, pFile, *(*int32)(unsafe.Pointer(bp)), int32(42379)) } else { rc = SQLITE_OK } @@ -25744,7 +25873,7 @@ func _unixTruncate(tls *libc.TLS, id uintptr, nByte Ti64) (r int32) { rc = _robust_ftruncate(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, nByte) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(6)<<libc.Int32FromInt32(8), __ccgo_ts+3493, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, int32(42197)) + return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(6)<<libc.Int32FromInt32(8), __ccgo_ts+3494, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, int32(42410)) } else { /* If the file was just truncated to a size smaller than the currently ** mapped region, reduce the effective mapping size as well. SQLite will @@ -25825,7 +25954,7 @@ func _fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte Ti64) (r int32) { if iWrite >= nSize { iWrite = nSize - int64(1) } - nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1662, int32(1)) + nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1663, int32(1)) if nWrite != int32(1) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(3)<<libc.Int32FromInt32(8) } @@ -25840,7 +25969,7 @@ func _fcntlSizeHint(tls *libc.TLS, pFile uintptr, nByte Ti64) (r int32) { if (*TunixFile)(unsafe.Pointer(pFile)).FszChunk <= 0 { if _robust_ftruncate(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, nByte) != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(6)<<libc.Int32FromInt32(8), __ccgo_ts+3493, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, int32(42318)) + return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(6)<<libc.Int32FromInt32(8), __ccgo_ts+3494, (*TunixFile)(unsafe.Pointer(pFile)).FzPath, int32(42531)) } } rc = _unixMapfile(tls, pFile, nByte) @@ -25887,6 +26016,10 @@ func _unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int3 _, _, _, _, _ = newLimit, pFile, rc, rc1, zTFile pFile = id switch op { + case int32(SQLITE_FCNTL_NULL_IO): + (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh) + (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) + return SQLITE_OK case int32(SQLITE_FCNTL_LOCKSTATE): *(*int32)(unsafe.Pointer(pArg)) = libc.Int32FromUint8((*TunixFile)(unsafe.Pointer(pFile)).FeFileLock) return SQLITE_OK @@ -25906,7 +26039,7 @@ func _unixFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int3 _unixModeBit(tls, pFile, uint8(UNIXFILE_PSOW), pArg) return SQLITE_OK case int32(SQLITE_FCNTL_VFSNAME): - *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, (*Tsqlite3_vfs)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpVfs)).FzName)) + *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, (*Tsqlite3_vfs)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpVfs)).FzName)) return SQLITE_OK case int32(SQLITE_FCNTL_TEMPFILENAME): zTFile = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pFile)).FpVfs)).FmxPathname)) @@ -25962,6 +26095,7 @@ func _setDeviceCharacteristics(tls *libc.TLS, pFd uintptr) { if libc.Int32FromUint16((*TunixFile)(unsafe.Pointer(pFd)).FctrlFlags)&int32(UNIXFILE_PSOW) != 0 { *(*int32)(unsafe.Pointer(pFd + 116)) |= int32(SQLITE_IOCAP_POWERSAFE_OVERWRITE) } + *(*int32)(unsafe.Pointer(pFd + 116)) |= int32(SQLITE_IOCAP_SUBPAGE_READ) (*TunixFile)(unsafe.Pointer(pFd)).FsectorSize = int32(SQLITE_DEFAULT_SECTOR_SIZE) } } @@ -26246,7 +26380,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(42916)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26309,7 +26443,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<<libc.Int32FromInt32(8), __ccgo_ts+3493, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, int32(42986)) + rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<<libc.Int32FromInt32(8), __ccgo_ts+3494, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, int32(43205)) } } } else { @@ -26402,7 +26536,7 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { v1 = pShmNode + 1*96 (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FzFilename = v1 zShm = v1 - Xsqlite3_snprintf(tls, nShmFilename, zShm, __ccgo_ts+3873, libc.VaList(bp+136, zBasePath)) + Xsqlite3_snprintf(tls, nShmFilename, zShm, __ccgo_ts+3874, libc.VaList(bp+136, zBasePath)) (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm = -int32(1) (*TunixInodeInfo)(unsafe.Pointer((*TunixFile)(unsafe.Pointer(pDbFd)).FpInode)).FpShmNode = pShmNode (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpInode = (*TunixFile)(unsafe.Pointer(pDbFd)).FpInode @@ -26414,13 +26548,13 @@ func _unixOpenSharedMemory(tls *libc.TLS, pDbFd uintptr) (r int32) { } } if libc.Int32FromUint8((*TunixInodeInfo)(unsafe.Pointer(pInode)).FbProcessLock) == 0 { - if 0 == Xsqlite3_uri_boolean(tls, (*TunixFile)(unsafe.Pointer(pDbFd)).FzPath, __ccgo_ts+3880, 0) { + if 0 == Xsqlite3_uri_boolean(tls, (*TunixFile)(unsafe.Pointer(pDbFd)).FzPath, __ccgo_ts+3881, 0) { (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm = _robust_open(tls, zShm, libc.Int32FromInt32(O_RDWR)|libc.Int32FromInt32(O_CREAT)|libc.Int32FromInt32(O_NOFOLLOW), (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&libc.Uint32FromInt32(0777)) } if (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm < 0 { (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm = _robust_open(tls, zShm, libc.Int32FromInt32(O_RDONLY)|libc.Int32FromInt32(O_NOFOLLOW), (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&libc.Uint32FromInt32(0777)) if (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FhShm < 0 { - rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(43123)), __ccgo_ts+3457, zShm, int32(43123)) + rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(43342)), __ccgo_ts+3458, zShm, int32(43342)) goto shm_open_err } (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FisReadonly = uint8(1) @@ -26540,9 +26674,9 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte break } *(*int32)(unsafe.Pointer(bp + 128)) = 0 - if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1662, int32(1), bp+128) != int32(1) { + if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1663, int32(1), bp+128) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<<libc.Int32FromInt32(8), __ccgo_ts+3528, zFile, int32(43267)) + rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<<libc.Int32FromInt32(8), __ccgo_ts+3529, zFile, int32(43486)) goto shmpage_out } goto _1 @@ -26570,7 +26704,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte } pMem = (*(*func(*libc.TLS, uintptr, Tsize_t, int32, int32, int32, Toff_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(22)].FpCurrent})))(tls, uintptr(0), libc.Uint64FromInt32(nMap), v2, int32(MAP_SHARED), (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(szRegion)*libc.Int64FromUint16((*TunixShmNode)(unsafe.Pointer(pShmNode)).FnRegion)) if pMem == uintptr(-libc.Int32FromInt32(1)) { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(21)<<libc.Int32FromInt32(8), __ccgo_ts+3615, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, int32(43294)) + rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(21)<<libc.Int32FromInt32(8), __ccgo_ts+3616, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename, int32(43513)) goto shmpage_out } } else { @@ -26878,7 +27012,7 @@ func _unixRemapfile(tls *libc.TLS, pFd uintptr, nNew Ti64) { var pNew, pOrig, pReq, zErr uintptr var v1 Tsqlite3_int64 _, _, _, _, _, _, _, _, _ = flags, h, nOrig, nReuse, pNew, pOrig, pReq, zErr, v1 - zErr = __ccgo_ts + 3615 + zErr = __ccgo_ts + 3616 h = (*TunixFile)(unsafe.Pointer(pFd)).Fh /* File descriptor open on db file */ pOrig = (*TunixFile)(unsafe.Pointer(pFd)).FpMapRegion /* Pointer to current file mapping */ nOrig = (*TunixFile)(unsafe.Pointer(pFd)).FmmapSizeActual /* Size of pOrig region in bytes */ @@ -26892,7 +27026,7 @@ func _unixRemapfile(tls *libc.TLS, pFd uintptr, nNew Ti64) { (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, pReq, libc.Uint64FromInt64(nOrig-nReuse)) } pNew = (*(*func(*libc.TLS, uintptr, Tsize_t, Tsize_t, int32, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(24)].FpCurrent})))(tls, pOrig, libc.Uint64FromInt64(nReuse), libc.Uint64FromInt64(nNew), int32(MREMAP_MAYMOVE), 0) - zErr = __ccgo_ts + 3627 + zErr = __ccgo_ts + 3628 /* The attempt to extend the existing mapping failed. Free it. */ if pNew == uintptr(-libc.Int32FromInt32(1)) || pNew == uintptr(0) { (*(*func(*libc.TLS, uintptr, Tsize_t) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(23)].FpCurrent})))(tls, pOrig, libc.Uint64FromInt64(nReuse)) @@ -26905,7 +27039,7 @@ func _unixRemapfile(tls *libc.TLS, pFd uintptr, nNew Ti64) { if pNew == uintptr(-libc.Int32FromInt32(1)) { pNew = uintptr(0) nNew = 0 - _unixLogErrorAtLine(tls, SQLITE_OK, zErr, (*TunixFile)(unsafe.Pointer(pFd)).FzPath, int32(43734)) + _unixLogErrorAtLine(tls, SQLITE_OK, zErr, (*TunixFile)(unsafe.Pointer(pFd)).FzPath, int32(43953)) /* If the mmap() above failed, assume that all subsequent mmap() calls ** will probably fail too. Fall back to using xRead/xWrite exclusively ** in this case. */ @@ -27241,11 +27375,11 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam } else { v1 = uintptr(0) } - if Xsqlite3_uri_boolean(tls, v1, __ccgo_ts+3893, int32(SQLITE_POWERSAFE_OVERWRITE)) != 0 { + if Xsqlite3_uri_boolean(tls, v1, __ccgo_ts+3894, int32(SQLITE_POWERSAFE_OVERWRITE)) != 0 { p2 = pNew + 30 *(*uint16)(unsafe.Pointer(p2)) = uint16(int32(*(*uint16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(UNIXFILE_PSOW)) } - if libc.Xstrcmp(tls, (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FzName, __ccgo_ts+3898) == 0 { + if libc.Xstrcmp(tls, (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FzName, __ccgo_ts+3899) == 0 { p3 = pNew + 30 *(*uint16)(unsafe.Pointer(p3)) = uint16(int32(*(*uint16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(UNIXFILE_EXCL)) } @@ -27276,7 +27410,7 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam ** 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, int32(44242)) + _robust_close(tls, pNew, h, int32(44461)) h = -int32(1) } _unixLeaveMutex(tls) @@ -27287,7 +27421,7 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam if zLockFile == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nFilename, zLockFile, __ccgo_ts+3908, libc.VaList(bp+8, zFilename)) + Xsqlite3_snprintf(tls, nFilename, zLockFile, __ccgo_ts+3909, libc.VaList(bp+8, zFilename)) } (*TunixFile)(unsafe.Pointer(pNew)).FlockingContext = zLockFile } @@ -27295,7 +27429,7 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam _storeLastErrno(tls, pNew, 0) if rc != SQLITE_OK { if h >= 0 { - _robust_close(tls, pNew, h, int32(44327)) + _robust_close(tls, pNew, h, int32(44546)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27310,10 +27444,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3916, - 3: __ccgo_ts + 3925, - 4: __ccgo_ts + 3934, - 5: __ccgo_ts + 1675, + 2: __ccgo_ts + 3917, + 3: __ccgo_ts + 3926, + 4: __ccgo_ts + 3935, + 5: __ccgo_ts + 1676, } // C documentation @@ -27322,8 +27456,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3939) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3953) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3940) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3954) } // C documentation @@ -27385,7 +27519,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = uint8(0) - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3960, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3961, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -27557,7 +27691,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** 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. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3977) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3978) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -27712,7 +27846,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44775)), __ccgo_ts+3457, zName, int32(44775)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3458, zName, int32(44994)) if rc == SQLITE_OK { rc = rc2 } @@ -27789,7 +27923,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)<<libc.Int32FromInt32(8) } else { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(10)<<libc.Int32FromInt32(8), __ccgo_ts+3567, zPath, int32(44914)) + rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(10)<<libc.Int32FromInt32(8), __ccgo_ts+3568, zPath, int32(45133)) } return rc } @@ -27797,9 +27931,9 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(17)].FpCurrent})))(tls, zPath, bp) if rc == SQLITE_OK { if _full_fsync(tls, *(*int32)(unsafe.Pointer(bp)), 0, 0) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(5)<<libc.Int32FromInt32(8), __ccgo_ts+3984, zPath, int32(44924)) + rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(5)<<libc.Int32FromInt32(8), __ccgo_ts+3985, zPath, int32(45143)) } - _robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp)), int32(44926)) + _robust_close(tls, uintptr(0), *(*int32)(unsafe.Pointer(bp)), int32(45145)) } else { rc = SQLITE_OK } @@ -27906,7 +28040,7 @@ func _appendOnePathElement(tls *libc.TLS, pPath uintptr, zName uintptr, nName in zIn = (*TDbPath)(unsafe.Pointer(pPath)).FzOut if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(27)].FpCurrent})))(tls, zIn, bp) != 0 { if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != int32(ENOENT) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45020)), __ccgo_ts+3655, zIn, int32(45020)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45239)), __ccgo_ts+3656, zIn, int32(45239)) } } else { if (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&uint32(S_IFMT) == uint32(S_IFLNK) { @@ -27914,12 +28048,12 @@ func _appendOnePathElement(tls *libc.TLS, pPath uintptr, zName uintptr, nName in v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ if v5 > int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45026)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+128, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(4098)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45031)), __ccgo_ts+3646, zIn, int32(45031)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3647, zIn, int32(45250)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 128)))[got] = uint8(0) @@ -27987,14 +28121,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45089)), __ccgo_ts+3475, zPath, int32(45089)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3476, zPath, int32(45308)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*uint8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = uint8(0) if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45095)) + return _sqlite3CantopenError(tls, int32(45314)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8) @@ -28034,7 +28168,7 @@ 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, __ccgo_ts+3859, libc.VaList(bp+8, zErr)) + Xsqlite3_snprintf(tls, nBuf, zBufOut, __ccgo_ts+3860, libc.VaList(bp+8, zErr)) } _unixLeaveMutex(tls) } @@ -28079,7 +28213,7 @@ func _unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) ( */ libc.Xmemset(tls, zBuf, 0, libc.Uint64FromInt32(nBuf)) libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_randomnessPid)), libc.Xgetpid(tls)) - fd = _robust_open(tls, __ccgo_ts+3990, O_RDONLY, uint32(0)) + fd = _robust_open(tls, __ccgo_ts+3991, O_RDONLY, uint32(0)) if fd < 0 { libc.Xtime(tls, bp) libc.Xmemcpy(tls, zBuf, bp, uint64(8)) @@ -28090,7 +28224,7 @@ func _unixRandomness(tls *libc.TLS, NotUsed uintptr, nBuf int32, zBuf uintptr) ( for cond := true; cond; cond = got < 0 && *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(EINTR) { got = int32((*(*func(*libc.TLS, int32, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(8)].FpCurrent})))(tls, fd, zBuf, libc.Uint64FromInt32(nBuf))) } - _robust_close(tls, uintptr(0), fd, int32(45197)) + _robust_close(tls, uintptr(0), fd, int32(45416)) } return nBuf } @@ -28440,25 +28574,25 @@ var _aVfs = [4]Tsqlite3_vfs{ FiVersion: int32(3), FszOsFile: int32(120), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4003, + FzName: __ccgo_ts + 4004, }, 1: { FiVersion: int32(3), FszOsFile: int32(120), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4008, + FzName: __ccgo_ts + 4009, }, 2: { FiVersion: int32(3), FszOsFile: int32(120), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4018, + FzName: __ccgo_ts + 4019, }, 3: { FiVersion: int32(3), FszOsFile: int32(120), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 3898, + FzName: __ccgo_ts + 3899, }, } @@ -28737,7 +28871,7 @@ var _memdb_g TMemFS var _memdb_vfs = Tsqlite3_vfs{ FiVersion: int32(2), FmxPathname: int32(1024), - FzName: __ccgo_ts + 4031, + FzName: __ccgo_ts + 4032, } func init() { @@ -29083,7 +29217,7 @@ func _memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = int32(SQLITE_NOTFOUND) _memdbEnter(tls, p) if op == int32(SQLITE_FCNTL_VFSNAME) { - *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4037, libc.VaList(bp+8, (*TMemStore)(unsafe.Pointer(p)).FaData, (*TMemStore)(unsafe.Pointer(p)).Fsz)) + *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4038, libc.VaList(bp+8, (*TMemStore)(unsafe.Pointer(p)).FaData, (*TMemStore)(unsafe.Pointer(p)).Fsz)) rc = SQLITE_OK } if op == int32(SQLITE_FCNTL_SIZE_LIMIT) { @@ -29258,7 +29392,7 @@ func _memdbFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, bp := tls.Alloc(16) defer tls.Free(16) _ = pVfs - Xsqlite3_snprintf(tls, nOut, zOut, __ccgo_ts+3859, libc.VaList(bp+8, zPath)) + Xsqlite3_snprintf(tls, nOut, zOut, __ccgo_ts+3860, libc.VaList(bp+8, zPath)) return SQLITE_OK } @@ -29405,7 +29539,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp return uintptr(0) } szPage = _sqlite3BtreeGetPageSize(tls, pBt) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4052, libc.VaList(bp+24, zSchema)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4053, libc.VaList(bp+24, zSchema)) if zSql != 0 { v1 = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), bp, uintptr(0)) } else { @@ -29423,7 +29557,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) * int64(szPage) if sz == 0 { Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) - Xsqlite3_exec(tls, db, __ccgo_ts+4075, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4076, uintptr(0), uintptr(0), uintptr(0)) rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == int32(SQLITE_ROW) { sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) * int64(szPage) @@ -29486,7 +29620,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint rc = int32(SQLITE_ERROR) goto end_deserialize } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4100, libc.VaList(bp+16, zSchema)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4101, libc.VaList(bp+16, zSchema)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -31365,7 +31499,7 @@ func _pcache1InitBulk(tls *libc.TLS, pCache uintptr) (r int32) { for { pX = zBulk + uintptr((*TPCache1)(unsafe.Pointer(pCache)).FszPage) (*TPgHdr1)(unsafe.Pointer(pX)).Fpage.FpBuf = zBulk - (*TPgHdr1)(unsafe.Pointer(pX)).Fpage.FpExtra = pX + 1*56 + (*TPgHdr1)(unsafe.Pointer(pX)).Fpage.FpExtra = pX + uintptr((libc.Uint64FromInt64(56)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TPgHdr1)(unsafe.Pointer(pX)).FisBulkLocal = uint16(1) (*TPgHdr1)(unsafe.Pointer(pX)).FisAnchor = uint16(0) (*TPgHdr1)(unsafe.Pointer(pX)).FpNext = (*TPCache1)(unsafe.Pointer(pCache)).FpFree @@ -31508,7 +31642,7 @@ func _pcache1AllocPage(tls *libc.TLS, pCache uintptr, benignMalloc int32) (r uin } p = pPg + uintptr((*TPCache1)(unsafe.Pointer(pCache)).FszPage) (*TPgHdr1)(unsafe.Pointer(p)).Fpage.FpBuf = pPg - (*TPgHdr1)(unsafe.Pointer(p)).Fpage.FpExtra = p + 1*56 + (*TPgHdr1)(unsafe.Pointer(p)).Fpage.FpExtra = p + uintptr((libc.Uint64FromInt64(56)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TPgHdr1)(unsafe.Pointer(p)).FisBulkLocal = uint16(0) (*TPgHdr1)(unsafe.Pointer(p)).FisAnchor = uint16(0) (*TPgHdr1)(unsafe.Pointer(p)).FpLruPrev = uintptr(0) /* Initializing this saves a valgrind error */ @@ -32998,6 +33132,7 @@ type TWal = struct { FzWalName uintptr FnCkpt Tu32 FpSnapshot uintptr + FbGetSnapshot int32 } type Wal = TWal @@ -33727,28 +33862,16 @@ var _aJournalMagic = [8]uint8{ ** interfaces to access the database using memory-mapped I/O. */ -/* -** The argument to this macro is a file descriptor (type sqlite3_file*). -** Return 0 if it is not open, or non-zero (but not 1) if it is. -** -** This is so that expressions can be written as: -** -** if( isOpen(pPager->jfd) ){ ... -** -** instead of -** -** if( pPager->jfd->pMethods ){ ... - */ - // C documentation // // /* // ** Return true if page pgno can be read directly from the database file // ** by the b-tree layer. This is the case if: // ** -// ** * the database file is open, -// ** * there are no dirty pages in the cache, and -// ** * the desired page is not currently in the wal file. +// ** (1) the database file is open +// ** (2) the VFS for the database is able to do unaligned sub-page reads +// ** (3) there are no dirty pages in the cache, and +// ** (4) the desired page is not currently in the wal file. // */ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int32) { bp := tls.Alloc(16) @@ -33756,14 +33879,19 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int var _ /* iRead at bp+0 */ Tu32 if (*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods == uintptr(0) { return 0 - } + } /* Case (1) */ if _sqlite3PCacheIsDirty(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache) != 0 { return 0 - } + } /* Failed (3) */ if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp) - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) + if *(*Tu32)(unsafe.Pointer(bp)) != 0 { + return 0 + } /* Case (4) */ + } + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + return 0 /* Case (2) */ } return int32(1) } @@ -34808,7 +34936,7 @@ func _pager_end_transaction(tls *libc.TLS, pPager uintptr, hasSuper int32, bComm } (*TPager)(unsafe.Pointer(pPager)).FjournalOff = 0 } else { - if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_PERSIST) || (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) != int32(PAGER_JOURNALMODE_WAL) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) == int32(PAGER_JOURNALMODE_PERSIST) || (*TPager)(unsafe.Pointer(pPager)).FexclusiveMode != 0 && libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FjournalMode) < int32(PAGER_JOURNALMODE_WAL) { rc = _zeroJournalHdr(tls, pPager, libc.BoolInt32(hasSuper != 0 || (*TPager)(unsafe.Pointer(pPager)).FtempFile != 0)) (*TPager)(unsafe.Pointer(pPager)).FjournalOff = 0 } else { @@ -35680,7 +35808,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<<libc.Int32FromInt32(8), __ccgo_ts+4115, libc.VaList(bp+32, nPlayback, (*TPager)(unsafe.Pointer(pPager)).FzJournal)) + Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<<libc.Int32FromInt32(8), __ccgo_ts+4116, libc.VaList(bp+32, nPlayback, (*TPager)(unsafe.Pointer(pPager)).FzJournal)) } /* The Pager.sectorSize variable may have been updated while rolling ** back a journal created by a process with a different sector size @@ -37406,7 +37534,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(61898)) + rc = _sqlite3CantopenError(tls, int32(62120)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -37492,7 +37620,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4142, uint64(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4143, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -37502,7 +37630,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4151, uint64(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4152, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -37544,8 +37672,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4156, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4163, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4157, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4164, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -37884,7 +38012,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62419)) + rc = _sqlite3CantopenError(tls, int32(62641)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38059,7 +38187,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62632)) + return _sqlite3CorruptError(tls, int32(62854)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38090,7 +38218,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62664)) + rc = _sqlite3CorruptError(tls, int32(62886)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -38162,7 +38290,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62747)) + return _sqlite3CorruptError(tls, int32(62969)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -39519,7 +39647,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64313)) + return _sqlite3CorruptError(tls, int32(64535)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -39787,7 +39915,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4173, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4174, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -40092,7 +40220,7 @@ func _sqlite3PagerSnapshotUnlock(tls *libc.TLS, pPager uintptr) { ** 28: Checksum-2 (second part of checksum for first 24 bytes of header). ** ** Immediately following the wal-header are zero or more frames. Each -** frame consists of a 24-byte frame-header followed by a <page-size> bytes +** frame consists of a 24-byte frame-header followed by <page-size> bytes ** of page data. The frame-header is six big-endian 32-bit unsigned ** integer values, as follows: ** @@ -40584,6 +40712,7 @@ type TWal1 = struct { FzWalName uintptr FnCkpt Tu32 FpSnapshot uintptr + FbGetSnapshot int32 } type Wal1 = TWal1 @@ -41228,7 +41357,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66239)) + return _sqlite3CorruptError(tls, int32(66462)) } goto _1 _1: @@ -41316,7 +41445,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66371)) + rc = _sqlite3CantopenError(tls, int32(66594)) goto finished } /* Malloc a buffer to read frames into. */ @@ -41455,7 +41584,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<<libc.Int32FromInt32(8), __ccgo_ts+4191, libc.VaList(bp+64, (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)<<libc.Int32FromInt32(8), __ccgo_ts+4192, libc.VaList(bp+64, (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } goto recovery_error @@ -41533,12 +41662,12 @@ func _sqlite3WalOpen(tls *libc.TLS, pVfs uintptr, pDbFd uintptr, zWalName uintpt */ /* Allocate an instance of struct Wal to return. */ *(*uintptr)(unsafe.Pointer(ppWal)) = uintptr(0) - pRet = _sqlite3MallocZero(tls, uint64(152)+libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile)) + pRet = _sqlite3MallocZero(tls, uint64(160)+libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile)) if !(pRet != 0) { return int32(SQLITE_NOMEM) } (*TWal)(unsafe.Pointer(pRet)).FpVfs = pVfs - (*TWal)(unsafe.Pointer(pRet)).FpWalFd = pRet + 1*152 + (*TWal)(unsafe.Pointer(pRet)).FpWalFd = pRet + 1*160 (*TWal)(unsafe.Pointer(pRet)).FpDbFd = pDbFd (*TWal)(unsafe.Pointer(pRet)).FreadLock = int16(-int32(1)) (*TWal)(unsafe.Pointer(pRet)).FmxWalSize = mxWalSize @@ -42086,7 +42215,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** 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 = _sqlite3CorruptError(tls, int32(67181)) + rc = _sqlite3CorruptError(tls, int32(67404)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42202,7 +42331,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4228, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4229, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -42443,7 +42572,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67625)) + rc = _sqlite3CantopenError(tls, int32(67848)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -42734,8 +42863,8 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 var cnt, i, mxI, nDelay, rc, v1, v4, v5 int32 var mxFrame, mxReadMark, thisMark Tu32 var pInfo uintptr - _, _, _, _, _, _, _, _, _, _, _, _ = cnt, i, mxFrame, mxI, mxReadMark, nDelay, pInfo, rc, thisMark, v1, v4, v5 /* Loop counter */ - rc = SQLITE_OK /* Wal frame to lock to */ + _, _, _, _, _, _, _, _, _, _, _, _ = cnt, i, mxFrame, mxI, mxReadMark, nDelay, pInfo, rc, thisMark, v1, v4, v5 /* Checkpoint information in wal-index */ + rc = SQLITE_OK /* Return code */ /* Not currently locked */ /* useWal may only be set for read/write connections */ /* Take steps to avoid spinning forever if there is a protocol error. @@ -42812,7 +42941,8 @@ func _walTryBeginRead(tls *libc.TLS, pWal uintptr, pChanged uintptr, useWal int3 } } pInfo = _walCkptInfo(tls, pWal) - if !(useWal != 0) && libc.AtomicLoadNUint32(pInfo, libc.Int32FromInt32(__ATOMIC_RELAXED)) == (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame && ((*TWal)(unsafe.Pointer(pWal)).FpSnapshot == uintptr(0) || (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame == uint32(0)) { + /* Wal frame to lock to */ + if !(useWal != 0) && libc.AtomicLoadNUint32(pInfo, libc.Int32FromInt32(__ATOMIC_RELAXED)) == (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame && ((*TWal)(unsafe.Pointer(pWal)).FbGetSnapshot == 0 && (*TWal)(unsafe.Pointer(pWal)).FpSnapshot == uintptr(0) || (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame == uint32(0)) { /* The WAL has been completely backfilled (or it is empty). ** and can be safely ignored. */ @@ -43253,7 +43383,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68469)) + return _sqlite3CorruptError(tls, int32(68694)) } iKey = _walNextHash(tls, iKey) } @@ -43750,7 +43880,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(68992)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -43999,7 +44129,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69252)) + rc = _sqlite3CorruptError(tls, int32(69477)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -44155,7 +44285,20 @@ var _aZero = [4]Tu32{} // /* Try to open on pSnapshot when the next read-transaction starts // */ func _sqlite3WalSnapshotOpen(tls *libc.TLS, pWal uintptr, pSnapshot uintptr) { - (*TWal)(unsafe.Pointer(pWal)).FpSnapshot = pSnapshot + if pSnapshot != 0 && (*TWalIndexHdr)(unsafe.Pointer(pSnapshot)).FiVersion == uint32(0) { + /* iVersion==0 means that this is a call to sqlite3_snapshot_get(). In + ** this case set the bGetSnapshot flag so that if the call to + ** sqlite3_snapshot_get() is about to read transaction on this wal + ** file, it does not take read-lock 0 if the wal file has been completely + ** checkpointed. Taking read-lock 0 would work, but then it would be + ** possible for a subsequent writer to destroy the snapshot even while + ** this connection is holding its read-transaction open. This is contrary + ** to user expectations, so we avoid it by not taking read-lock 0. */ + (*TWal)(unsafe.Pointer(pWal)).FbGetSnapshot = int32(1) + } else { + (*TWal)(unsafe.Pointer(pWal)).FpSnapshot = pSnapshot + (*TWal)(unsafe.Pointer(pWal)).FbGetSnapshot = 0 + } } // C documentation @@ -45843,7 +45986,7 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71421)) + rc = _sqlite3CorruptError(tls, int32(71659)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } @@ -46021,7 +46164,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71619)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46034,12 +46177,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* 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)) = _sqlite3CorruptError(tls, int32(71632)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71637)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46083,7 +46226,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71682)) + return _sqlite3CorruptError(tls, int32(71920)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46091,7 +46234,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71690)) + return _sqlite3CorruptError(tls, int32(71928)) } return SQLITE_OK } @@ -46511,7 +46654,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72130)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -46551,12 +46694,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)) + 1))) if iFree > usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72188)) + return _sqlite3CorruptError(tls, int32(72426)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree) + 1))) if iFree2 > usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72191)) + return _sqlite3CorruptError(tls, int32(72429)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -46564,21 +46707,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)) + 1))) top = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1))) if top >= iFree { - return _sqlite3CorruptError(tls, int32(72199)) + return _sqlite3CorruptError(tls, int32(72437)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72202)) + return _sqlite3CorruptError(tls, int32(72440)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)) + 1))) if iFree2+sz2 > usableSize { - return _sqlite3CorruptError(tls, int32(72204)) + return _sqlite3CorruptError(tls, int32(72442)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72208)) + return _sqlite3CorruptError(tls, int32(72446)) } } cbrk = top + sz @@ -46625,12 +46768,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72241)) + return _sqlite3CorruptError(tls, int32(72479)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72247)) + return _sqlite3CorruptError(tls, int32(72485)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -46646,7 +46789,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72261)) + return _sqlite3CorruptError(tls, int32(72499)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -46706,7 +46849,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72318)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -46723,14 +46866,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72333)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72340)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) } return uintptr(0) } @@ -46773,11 +46916,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72388)) + return _sqlite3CorruptError(tls, int32(72626)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72391)) + return _sqlite3CorruptError(tls, int32(72629)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -46791,7 +46934,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72408)) + return _sqlite3CorruptError(tls, int32(72646)) } else { return SQLITE_OK } @@ -46874,12 +47017,12 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) if libc.Int32FromUint16(iFreeBlk) == 0 { break } /* TH3: corrupt082.100 */ - return _sqlite3CorruptError(tls, int32(72487)) + return _sqlite3CorruptError(tls, int32(72725)) } iPtr = iFreeBlk } if uint32(iFreeBlk) > (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72492)) + return _sqlite3CorruptError(tls, int32(72730)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -46890,11 +47033,11 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { nFrag = uint8(uint32(iFreeBlk) - iEnd) if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72504)) + return _sqlite3CorruptError(tls, int32(72742)) } iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)) + 1))))) if iEnd > (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72507)) + return _sqlite3CorruptError(tls, int32(72745)) } iSize = uint16(iEnd - uint32(iStart)) iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk) + 1)))) @@ -46907,7 +47050,7 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<<int32(8) | libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)) + 1)))) if iPtrEnd+int32(3) >= libc.Int32FromUint16(iStart) { if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72520)) + return _sqlite3CorruptError(tls, int32(72758)) } nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) iSize = uint16(iEnd - uint32(iPtr)) @@ -46915,7 +47058,7 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) } } if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72526)) + return _sqlite3CorruptError(tls, int32(72764)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) @@ -46932,10 +47075,10 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** so just extend the cell content area rather than create another ** freelist entry */ if libc.Int32FromUint16(iStart) < libc.Int32FromUint16(x) { - return _sqlite3CorruptError(tls, int32(72540)) + return _sqlite3CorruptError(tls, int32(72778)) } if libc.Int32FromUint16(iPtr) != libc.Int32FromUint8(hdr)+int32(1) { - return _sqlite3CorruptError(tls, int32(72541)) + return _sqlite3CorruptError(tls, int32(72779)) } *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) @@ -46996,7 +47139,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72595)) + return _sqlite3CorruptError(tls, int32(72833)) } } } else { @@ -47022,7 +47165,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72619)) + return _sqlite3CorruptError(tls, int32(72857)) } } } @@ -47061,12 +47204,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* 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 _sqlite3CorruptError(tls, int32(72670)) + return _sqlite3CorruptError(tls, int32(72908)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72675)) + return _sqlite3CorruptError(tls, int32(72913)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc) + 1)))) size = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc+int32(2)))))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc+int32(2)) + 1)))) @@ -47078,11 +47221,11 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { } if next > uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72685)) + return _sqlite3CorruptError(tls, int32(72923)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72689)) + return _sqlite3CorruptError(tls, int32(72927)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47093,7 +47236,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72701)) + return _sqlite3CorruptError(tls, int32(72939)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47124,11 +47267,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72732)) + return _sqlite3CorruptError(tls, int32(72970)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72737)) + return _sqlite3CorruptError(tls, int32(72975)) } goto _1 _1: @@ -47157,7 +47300,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(72769)) + return _sqlite3CorruptError(tls, int32(73007)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) @@ -47170,7 +47313,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3 + 1)))) if uint32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) > ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(72783)) + return _sqlite3CorruptError(tls, int32(73021)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -47323,7 +47466,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(72926)) + return _sqlite3CorruptError(tls, int32(73164)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -47385,7 +47528,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(72998)) + return _sqlite3CorruptError(tls, int32(73236)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -47473,7 +47616,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4254) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4255) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48259,7 +48402,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** 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, __ccgo_ts+4263, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4264, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -48297,7 +48440,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(73936)) + rc = _sqlite3CorruptError(tls, int32(74174)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -48738,7 +48881,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74384)) + return _sqlite3CorruptError(tls, int32(74622)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -48762,7 +48905,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74403)) + return _sqlite3CorruptError(tls, int32(74641)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -48771,7 +48914,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74412)) + return _sqlite3CorruptError(tls, int32(74650)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -48785,7 +48928,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74424)) + return _sqlite3CorruptError(tls, int32(74662)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -48815,7 +48958,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74459)) + return _sqlite3CorruptError(tls, int32(74697)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -48911,7 +49054,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74557)) + return _sqlite3CorruptError(tls, int32(74795)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -48949,7 +49092,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74609)) + return _sqlite3CorruptError(tls, int32(74847)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49016,7 +49159,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74677)) + rc = _sqlite3CorruptError(tls, int32(74915)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49059,7 +49202,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74728)) + return _sqlite3CorruptError(tls, int32(74966)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49089,7 +49232,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74755)) + return _sqlite3CorruptError(tls, int32(74993)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49555,7 +49698,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75219)) + return _sqlite3CorruptError(tls, int32(75457)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -49947,7 +50090,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75624)) + return _sqlite3CorruptError(tls, int32(75881)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -49957,7 +50100,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75639)) + return _sqlite3CorruptError(tls, int32(75896)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50014,7 +50157,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75710)) + return _sqlite3CorruptError(tls, int32(75967)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50088,7 +50231,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(75794)) + return _sqlite3CorruptError(tls, int32(76051)) } return rc } @@ -50223,7 +50366,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(75932)) + return _sqlite3CorruptError(tls, int32(76189)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50235,7 +50378,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(75946)) + rc = _sqlite3CorruptError(tls, int32(76203)) } if rc != 0 { v3 = pCur + 84 @@ -50351,7 +50494,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76081)) + return _sqlite3CorruptError(tls, int32(76338)) } goto skip_init skip_init: @@ -50365,7 +50508,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76093)) + return _sqlite3CorruptError(tls, int32(76350)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -50599,7 +50742,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76342)) + return _sqlite3CorruptError(tls, int32(76599)) } } } @@ -50801,9 +50944,9 @@ func _sqlite3BtreeIndexMoveto(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, pRes } if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) > 0 && _indexCellCompare(tls, pCur, 0, pIdxKey, xRecordCompare) <= 0 && libc.Int32FromUint8((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode) == SQLITE_OK { p3 = pCur + 1 - *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^libc.Int32FromInt32(BTCF_ValidOvfl)) + *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^(libc.Int32FromInt32(BTCF_ValidOvfl) | libc.Int32FromInt32(BTCF_AtLast))) if !((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76538)) + return _sqlite3CorruptError(tls, int32(76795)) } goto bypass_moveto_root /* Start search on the current page */ } @@ -50866,7 +51009,7 @@ bypass_moveto_root: /* Invalid key size: 0x80 0x80 0x01 */ /* Minimum legal index key size */ if nCell < int32(2) || libc.Uint32FromInt32(nCell)/(*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FusableSize > (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76625)) + rc = _sqlite3CorruptError(tls, int32(76882)) goto moveto_index_finish } pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) @@ -50897,7 +51040,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76657)) + rc = _sqlite3CorruptError(tls, int32(76914)) } goto moveto_index_finish } @@ -50930,7 +51073,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76688)) + return _sqlite3CorruptError(tls, int32(76945)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -50939,7 +51082,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76699)) + rc = _sqlite3CorruptError(tls, int32(76956)) } if rc != 0 { v11 = pCur + 84 @@ -51068,7 +51211,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76800)) + return _sqlite3CorruptError(tls, int32(77057)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51178,7 +51321,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(76893)) + return _sqlite3CorruptError(tls, int32(77150)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51266,7 +51409,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(76983)) + return _sqlite3CorruptError(tls, int32(77240)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51321,7 +51464,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77039)) + rc = _sqlite3CorruptError(tls, int32(77296)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51347,7 +51490,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77068)) + rc = _sqlite3CorruptError(tls, int32(77325)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51374,7 +51517,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77102)) + rc = _sqlite3CorruptError(tls, int32(77359)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -51445,7 +51588,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77167)) + rc = _sqlite3CorruptError(tls, int32(77424)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51583,7 +51726,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77294)) + return _sqlite3CorruptError(tls, int32(77551)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -51634,7 +51777,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77341)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -51643,7 +51786,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77352)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -51733,7 +51876,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77441)) + return _sqlite3CorruptError(tls, int32(77698)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -51751,7 +51894,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 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 _sqlite3CorruptError(tls, int32(77458)) + return _sqlite3CorruptError(tls, int32(77715)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -51774,7 +51917,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77478)) + rc = _sqlite3CorruptError(tls, int32(77735)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -51995,7 +52138,7 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr + 1)))) hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if pc+libc.Uint32FromInt32(sz) > (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77734)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) return } rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) @@ -52374,7 +52517,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg libc.Xmemcpy(tls, pTmp+uintptr(j), aData+uintptr(j), uint64(libc.Uint32FromInt32(usableSize)-j)) k = 0 for { - if !(k < libc.Int32FromInt32(NB)*libc.Int32FromInt32(2) && *(*int32)(unsafe.Pointer(pCArray + 80 + uintptr(k)*4)) <= i) { + if !(*(*int32)(unsafe.Pointer(pCArray + 80 + uintptr(k)*4)) <= i) { break } goto _1 @@ -52389,12 +52532,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78123)) + return _sqlite3CorruptError(tls, int32(78381)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78128)) + return _sqlite3CorruptError(tls, int32(78386)) } } pData -= uintptr(sz) @@ -52402,7 +52545,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78134)) + return _sqlite3CorruptError(tls, int32(78392)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -52471,7 +52614,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr } k = 0 for { - if !(k < libc.Int32FromInt32(NB)*libc.Int32FromInt32(2) && *(*int32)(unsafe.Pointer(pCArray + 80 + uintptr(k)*4)) <= i) { + if !(*(*int32)(unsafe.Pointer(pCArray + 80 + uintptr(k)*4)) <= i) { break } goto _1 @@ -52497,7 +52640,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78219)) + _sqlite3CorruptError(tls, int32(78478)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -52645,7 +52788,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78341)) + return _sqlite3CorruptError(tls, int32(78600)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -52716,7 +52859,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78415)) + return _sqlite3CorruptError(tls, int32(78674)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -52761,7 +52904,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78455)) + return _sqlite3CorruptError(tls, int32(78714)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -52779,6 +52922,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt (*(*TCellArray)(unsafe.Pointer(bp + 32))).FszCell = bp + 24 *(*uintptr)(unsafe.Pointer(bp + 32 + 32)) = (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd *(*int32)(unsafe.Pointer(bp + 32 + 80)) = int32(2) + *(*int32)(unsafe.Pointer(bp + 32 + 80 + uintptr(libc.Int32FromInt32(NB)*libc.Int32FromInt32(2)-libc.Int32FromInt32(1))*4)) = int32(0x7fffffff) *(*int32)(unsafe.Pointer(bp + 8)) = _rebuildPage(tls, bp+32, 0, int32(1), *(*uintptr)(unsafe.Pointer(bp))) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -52978,7 +53122,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa iSpace1 = 0 /* First unused byte of aSpace1[] */ iOvflSpace = 0 /* Parsed information on cells being balanced */ libc.Xmemset(tls, bp+100, 0, uint64(5)) - libc.Xmemset(tls, bp+112, 0, uint64(104)) + libc.Xmemset(tls, bp+112, 0, libc.Uint64FromInt64(104)-libc.Uint64FromInt64(4)) + *(*int32)(unsafe.Pointer(bp + 112 + 80 + uintptr(libc.Int32FromInt32(NB)*libc.Int32FromInt32(2)-libc.Int32FromInt32(1))*4)) = int32(0x7fffffff) pBt = (*TMemPage)(unsafe.Pointer(pParent)).FpBt /* At this point pParent may have at most one overflow cell. And if ** this overflow cell is present, it must be the cell with @@ -53122,7 +53267,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(78876)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53145,7 +53290,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(78900)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53276,7 +53421,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79001)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -53319,7 +53464,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79034)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) goto balance_cleanup } } @@ -53378,7 +53523,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79078)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) goto balance_cleanup } goto _11 @@ -53410,7 +53555,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79111)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -53630,7 +53775,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa iOvflSpace += sz2 k = 0 for { - if !(k < libc.Int32FromInt32(NB)*libc.Int32FromInt32(2) && *(*int32)(unsafe.Pointer(bp + 112 + 80 + uintptr(k)*4)) <= j) { + if !(*(*int32)(unsafe.Pointer(bp + 112 + 80 + uintptr(k)*4)) <= j) { break } goto _28 @@ -53640,7 +53785,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79311)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -53886,7 +54031,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79543)) + return _sqlite3CorruptError(tls, int32(79806)) } goto _1 _1: @@ -53959,7 +54104,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79603)) + rc = _sqlite3CorruptError(tls, int32(79866)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -54118,7 +54263,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(79767)) + rc = _sqlite3CorruptError(tls, int32(80030)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54149,7 +54294,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(79795)) + return _sqlite3CorruptError(tls, int32(80058)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54234,7 +54379,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(79876)) + return _sqlite3CorruptError(tls, int32(80139)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54326,7 +54471,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79999)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54362,7 +54507,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80041)) + return _sqlite3CorruptError(tls, int32(80304)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -54392,10 +54537,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80068)) + return _sqlite3CorruptError(tls, int32(80331)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80071)) + return _sqlite3CorruptError(tls, int32(80334)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -54513,7 +54658,7 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80173)) + return _sqlite3CorruptError(tls, int32(80436)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { @@ -54535,7 +54680,7 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80198)) + return _sqlite3CorruptError(tls, int32(80461)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -54635,21 +54780,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80294)) + return _sqlite3CorruptError(tls, int32(80557)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80303)) + return _sqlite3CorruptError(tls, int32(80566)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80307)) + return _sqlite3CorruptError(tls, int32(80570)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80310)) + return _sqlite3CorruptError(tls, int32(80573)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -54743,7 +54888,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80401)) + return _sqlite3CorruptError(tls, int32(80664)) } nCell = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -54853,7 +54998,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+8) if *(*TPgno)(unsafe.Pointer(bp + 8)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80517)) + return _sqlite3CorruptError(tls, int32(80780)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -54894,7 +55039,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80565)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -54975,14 +55120,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80655)) + return _sqlite3CorruptError(tls, int32(80918)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80662)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55119,7 +55264,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80766)) + return _sqlite3CorruptError(tls, int32(81029)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55384,7 +55529,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4267, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4268, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -55432,11 +55577,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4269, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4270, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4292, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4293, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -55462,11 +55607,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) { _checkOom(tls, pCheck) } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4317, libc.VaList(bp+16, iChild)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4318, libc.VaList(bp+16, iChild)) return } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) != libc.Int32FromUint8(eType) || *(*TPgno)(unsafe.Pointer(bp + 4)) != iParent { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4346, libc.VaList(bp+16, iChild, libc.Int32FromUint8(eType), iParent, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))), *(*TPgno)(unsafe.Pointer(bp + 4)))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4347, libc.VaList(bp+16, iChild, libc.Int32FromUint8(eType), iParent, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))), *(*TPgno)(unsafe.Pointer(bp + 4)))) } } @@ -55493,7 +55638,7 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } N-- if _sqlite3PagerGet(tls, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FpPager, iPage, bp, 0) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4400, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4401, libc.VaList(bp+16, iPage)) break } pOvflData = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55503,7 +55648,7 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N _checkPtrmap(tls, pCheck, iPage, uint8(PTRMAP_FREEPAGE), uint32(0)) } if n > (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4422, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4423, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -55538,11 +55683,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4461 + v2 = __ccgo_ts + 4462 } else { - v2 = __ccgo_ts + 4466 + v2 = __ccgo_ts + 4467 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4487, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4488, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -55678,12 +55823,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4513 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4514 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4531, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4532, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) { (*TIntegrityCk)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -55697,19 +55842,19 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr rc = v2 if v2 != 0 { /* The only possible error from InitPage */ - _checkAppendMsg(tls, pCheck, __ccgo_ts+4569, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4570, libc.VaList(bp+56, rc)) goto end_of_check } v3 = _btreeComputeFreeSpace(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = v3 if v3 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4607, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4608, libc.VaList(bp+56, rc)) goto end_of_check } data = (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FhdrOffset) /* Set up for cell analysis */ - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4629 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4630 contentOffset = libc.Uint32FromInt32((libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))))<<libc.Int32FromInt32(8)|libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)))-libc.Int32FromInt32(1))&libc.Int32FromInt32(0xffff) + libc.Int32FromInt32(1)) /* Enforced by btreeInitPage() */ /* EVIDENCE-OF: R-37002-32774 The two-byte integer at offset 3 gives the @@ -55726,7 +55871,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr /* Analyze the right-child page of internal pages */ pgno = libc.Int32FromUint32(_sqlite3Get4byte(tls, data+uintptr(hdr+int32(8)))) if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 { - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4655 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4656 _checkPtrmap(tls, pCheck, libc.Uint32FromInt32(pgno), uint8(PTRMAP_BTREE), iPage) } depth = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) @@ -55749,14 +55894,14 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr pc = uint32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(pCellIdx)))) pCellIdx -= uintptr(2) if pc < contentOffset || pc > usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4685, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4686, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4715, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, 0) doCoverageCheck = 0 goto _4 } @@ -55768,7 +55913,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4739, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4740, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -55791,7 +55936,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4763, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4764, 0) depth = d2 } } else { @@ -55868,7 +56013,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4788, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4789, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -55882,7 +56027,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4825, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4826, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -55973,7 +56118,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4877 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4878 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -55997,11 +56142,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4888, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4889, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4933, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4934, 0) } } } @@ -56038,10 +56183,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+4988, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+4989, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5008, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5009, libc.VaList(bp+248, i)) } goto _3 _3: @@ -56480,7 +56625,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3859, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3860, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -56490,7 +56635,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5040, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5041, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -56519,7 +56664,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5060, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5061, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -56549,7 +56694,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5091, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5092, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -57227,7 +57372,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5131, libc.VaList(bp+48, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5132, libc.VaList(bp+48, v1)) *(*uint8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = uint8(0) /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -58039,7 +58184,7 @@ func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType if zPType != 0 { v1 = zPType } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } *(*uintptr)(unsafe.Pointer(pMem)) = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr @@ -58327,7 +58472,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84060)) + return _sqlite3CorruptError(tls, int32(84326)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -58588,7 +58733,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, if !(i < nVal) { break } - rc = _sqlite3ValueFromExpr(tls, db, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr, enc, aff, apVal+uintptr(i)*8) + rc = _sqlite3Stat4ValueFromExpr(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr, aff, apVal+uintptr(i)*8) if *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) == uintptr(0) || rc != SQLITE_OK { goto value_from_function_out } @@ -58610,7 +58755,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3859, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3860, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -58668,7 +58813,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity zVal = uintptr(0) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) negInt = int32(1) - zNeg = __ccgo_ts + 1662 + zNeg = __ccgo_ts + 1663 rc = SQLITE_OK for { v1 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) @@ -58710,7 +58855,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5138 + zNeg = __ccgo_ts + 5139 } } } @@ -58725,7 +58870,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5140, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5141, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59029,7 +59174,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(84745)) + return _sqlite3CorruptError(tls, int32(85012)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59045,7 +59190,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(84751)) + return _sqlite3CorruptError(tls, int32(85018)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59055,7 +59200,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(84757)) + return _sqlite3CorruptError(tls, int32(85024)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -59530,7 +59675,7 @@ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = pFunc (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = uintptr(0) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = 0 - (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = libc.Uint8FromInt32(nArg) + (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = libc.Uint16FromInt32(nArg) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp = _sqlite3VdbeCurrentAddr(tls, v) if eCallCtx != 0 { v1 = int32(OP_PureFunc) @@ -59695,7 +59840,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 68 + v2 = pParse + 72 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -59843,6 +59988,7 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { if n > nMaxArgs { nMaxArgs = n } + /* Fall through into the default case */ fallthrough default: if (*TOp)(unsafe.Pointer(pOp)).Fp2 < 0 { @@ -60084,6 +60230,8 @@ func _freeP4FuncCtx(tls *libc.TLS, db uintptr, p uintptr) { } func _freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { + var pSig uintptr + _ = pSig switch p4type { case -int32(15): _freeP4FuncCtx(tls, db, p4) @@ -60117,6 +60265,10 @@ func _freeP4(tls *libc.TLS, db uintptr, p4type int32, p4 uintptr) { if (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed == uintptr(0) { _sqlite3DeleteTable(tls, db, p4) } + case -int32(17): + pSig = p4 + _sqlite3DbFree(tls, db, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff) + _sqlite3DbFree(tls, db, pSig) break } } @@ -60357,17 +60509,17 @@ func _sqlite3VdbeGetLastOp(tls *libc.TLS, p uintptr) (r uintptr) { func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { bp := tls.Alloc(64) defer tls.Free(64) - var ai, pColl, pColl1, pDef, pDef1, pKeyInfo, pMem, pVtab, zColl, zP4, v2, v3, v4 uintptr + var ai, pColl, pColl1, pDef, pDef1, pKeyInfo, pMem, pSig, pVtab, zColl, zP4, v2, v3, v4 uintptr var i, n Tu32 var j, v6 int32 var _ /* x at bp+0 */ TStrAccum - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = ai, i, j, n, pColl, pColl1, pDef, pDef1, pKeyInfo, pMem, pVtab, zColl, zP4, v2, v3, v4, v6 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = ai, i, j, n, pColl, pColl1, pDef, pDef1, pKeyInfo, pMem, pSig, pVtab, zColl, zP4, v2, v3, v4, v6 zP4 = uintptr(0) _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, int32(SQLITE_MAX_LENGTH)) switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5145, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5146, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -60377,66 +60529,66 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if pColl != 0 { v2 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v2 = __ccgo_ts + 1662 + v2 = __ccgo_ts + 1663 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5150) == 0 { - zColl = __ccgo_ts + 5157 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5151) == 0 { + zColl = __ccgo_ts + 5158 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5138 + v3 = __ccgo_ts + 5139 } else { - v3 = __ccgo_ts + 1662 + v3 = __ccgo_ts + 1663 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5159 + v4 = __ccgo_ts + 5160 } else { - v4 = __ccgo_ts + 1662 + v4 = __ccgo_ts + 1663 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5162, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5163, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5170, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5186, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5187, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5195, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5195, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1423, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1424, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5202, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5203, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1390, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1391, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): pMem = *(*uintptr)(unsafe.Pointer(pOp + 16)) if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { zP4 = (*TMem)(unsafe.Pointer(pMem)).Fz } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1423, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1424, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1390, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1391, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { - zP4 = __ccgo_ts + 1663 + zP4 = __ccgo_ts + 1664 } else { - zP4 = __ccgo_ts + 5205 + zP4 = __ccgo_ts + 5206 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5212, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5213, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -60451,17 +60603,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5220, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5221, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5225, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5226, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5227 + zP4 = __ccgo_ts + 5228 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName + case -int32(17): + pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5236, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -60475,10 +60630,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5172, - 1: __ccgo_ts + 5174, - 2: __ccgo_ts + 5176, - 3: __ccgo_ts + 5181, + 0: __ccgo_ts + 5173, + 1: __ccgo_ts + 5175, + 2: __ccgo_ts + 5177, + 3: __ccgo_ts + 5182, } // C documentation @@ -61429,7 +61584,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5235, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5252, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -61437,18 +61592,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5247, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5264, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5261, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5278, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5276, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5293, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -61679,7 +61834,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)<<libc.Int32FromInt32(8) (*TVdbe)(unsafe.Pointer(p)).FerrorAction = uint8(OE_Abort) - _sqlite3VdbeError(tls, p, __ccgo_ts+5289, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5306, 0) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FprepFlags)&int32(SQLITE_PREPARE_SAVESQL) == 0 { return int32(SQLITE_ERROR) } @@ -62129,7 +62284,7 @@ func _sqlite3VdbeFinishMoveto(tls *libc.TLS, p uintptr) (r int32) { return rc } if *(*int32)(unsafe.Pointer(bp)) != 0 { - return _sqlite3CorruptError(tls, int32(88615)) + return _sqlite3CorruptError(tls, int32(88897)) } (*TVdbeCursor)(unsafe.Pointer(p)).FdeferredMoveto = uint8(0) (*TVdbeCursor)(unsafe.Pointer(p)).FcacheStatus = uint32(CACHE_STALE) @@ -62751,23 +62906,13 @@ func _sqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) (r int32) { // ** equal to, or greater than the second (double). // */ func _sqlite3IntFloatCompare(tls *libc.TLS, i Ti64, r float64) (r1 int32) { - var x float64 var y Ti64 - var v1, v2 int32 - _, _, _, _ = x, y, v1, v2 + var v1 int32 + _, _ = y, v1 if _sqlite3IsNaN(tls, r) != 0 { /* SQLite considers NaN to be a NULL. And all integer values are greater ** than NULL */ return int32(1) - } - if _sqlite3Config.FbUseLongDouble != 0 { - x = float64(i) - if x < r { - v1 = -int32(1) - } else { - v1 = libc.BoolInt32(x > r) - } - return v1 } else { if r < -libc.Float64FromFloat64(9.223372036854776e+18) { return +libc.Int32FromInt32(1) @@ -62783,11 +62928,11 @@ func _sqlite3IntFloatCompare(tls *libc.TLS, i Ti64, r float64) (r1 int32) { return +libc.Int32FromInt32(1) } if float64(i) < r { - v2 = -int32(1) + v1 = -int32(1) } else { - v2 = libc.BoolInt32(float64(i) > r) + v1 = libc.BoolInt32(float64(i) > r) } - return v2 + return v1 } return r1 } @@ -62987,7 +63132,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr i = 0 } if d1 > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89580))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63077,7 +63222,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89661))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63112,7 +63257,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89691))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63166,7 +63311,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89742))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) return 0 /* Corrupt index */ } } @@ -63298,7 +63443,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89905))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -63450,7 +63595,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90063)) + return _sqlite3CorruptError(tls, int32(90338)) } // C documentation @@ -63481,7 +63626,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90096)) + return _sqlite3CorruptError(tls, int32(90371)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -63632,15 +63777,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5319 + zContext = __ccgo_ts + 5336 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5338 + zContext = __ccgo_ts + 5355 } else { - zContext = __ccgo_ts + 5357 + zContext = __ccgo_ts + 5374 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5366, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5383, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -63709,16 +63854,16 @@ func _vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { // ** the required value will be read from the row the cursor points to. // */ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 Ti64, iReg int32, iBlobWrite int32) { - bp := tls.Alloc(144) - defer tls.Free(144) + bp := tls.Alloc(208) + defer tls.Free(208) var db, zTbl uintptr - var i int32 + var i, i1 int32 var iKey2, v1 Ti64 var _ /* preupdate at bp+0 */ TPreUpdate - _, _, _, _, _ = db, i, iKey2, zTbl, v1 + _, _, _, _, _, _ = db, i, i1, iKey2, zTbl, v1 db = (*TVdbe)(unsafe.Pointer(v)).Fdb zTbl = (*TTable)(unsafe.Pointer(pTab)).FzName - libc.Xmemset(tls, bp, 0, uint64(136)) + libc.Xmemset(tls, bp, 0, uint64(200)) if libc.BoolInt32((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0)) == 0 { v1 = libc.Int64FromInt32(0) iKey2 = v1 @@ -63749,6 +63894,7 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+112) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -63763,6 +63909,20 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, } _sqlite3DbNNFreeNN(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew) } + if (*(*TPreUpdate)(unsafe.Pointer(bp))).FapDflt != 0 { + i1 = 0 + for { + if !(i1 < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { + break + } + _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FapDflt + uintptr(i1)*8))) + goto _3 + _3: + ; + i1++ + } + _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FapDflt) + } } var _fakeSortOrder Tu8 @@ -63814,7 +63974,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5402, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5419, 0) return int32(1) } else { return 0 @@ -63824,7 +63984,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5447, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5464, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -63882,7 +64042,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90486)) + return _sqlite3MisuseError(tls, int32(90768)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -64385,7 +64545,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5487, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5504, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -64586,7 +64746,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91280)) + return _sqlite3MisuseError(tls, int32(91562)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -64716,7 +64876,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91401)) + return _sqlite3MisuseError(tls, int32(91683)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -65054,7 +65214,7 @@ func _columnMem(tls *libc.TLS, pStmt uintptr, i int32) (r uintptr) { // ** sqlite3_column_int64() // ** sqlite3_column_text() // ** sqlite3_column_text16() -// ** sqlite3_column_real() +// ** sqlite3_column_double() // ** sqlite3_column_bytes() // ** sqlite3_column_bytes16() // ** sqlite3_column_blob() @@ -65176,18 +65336,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5510, - 1: __ccgo_ts + 5515, - 2: __ccgo_ts + 5522, - 3: __ccgo_ts + 5525, - 4: __ccgo_ts + 5528, - 5: __ccgo_ts + 5531, - 6: __ccgo_ts + 5534, - 7: __ccgo_ts + 5537, - 8: __ccgo_ts + 5545, - 9: __ccgo_ts + 5548, - 10: __ccgo_ts + 5555, - 11: __ccgo_ts + 5563, + 0: __ccgo_ts + 5527, + 1: __ccgo_ts + 5532, + 2: __ccgo_ts + 5539, + 3: __ccgo_ts + 5542, + 4: __ccgo_ts + 5545, + 5: __ccgo_ts + 5548, + 6: __ccgo_ts + 5551, + 7: __ccgo_ts + 5554, + 8: __ccgo_ts + 5562, + 9: __ccgo_ts + 5565, + 10: __ccgo_ts + 5572, + 11: __ccgo_ts + 5580, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -65422,6 +65582,17 @@ func Xsqlite3_column_origin_name16(tls *libc.TLS, pStmt uintptr, N int32) (r uin // ** // ** The error code stored in database p->db is overwritten with the return // ** value in any case. +// ** +// ** (tag-20240917-01) If vdbeUnbind(p,(u32)(i-1)) returns SQLITE_OK, +// ** that means all of the the following will be true: +// ** +// ** p!=0 +// ** p->pVar!=0 +// ** i>0 +// ** i<=p->nVar +// ** +// ** An assert() is normally added after vdbeUnbind() to help static analyzers +// ** realize this. // */ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { bp := tls.Alloc(16) @@ -65431,14 +65602,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92005)) + return _sqlite3MisuseError(tls, int32(92299)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92009))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5570, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92013)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5587, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(92307)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -65483,6 +65654,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, p = pStmt rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { + /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) @@ -65523,6 +65695,7 @@ func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) p = pStmt rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { + /* tag-20240917-01 */ _sqlite3VdbeMemSetDouble(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, rValue) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } @@ -65540,6 +65713,7 @@ func Xsqlite3_bind_int64(tls *libc.TLS, pStmt uintptr, i int32, iValue Tsqlite_i p = pStmt rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { + /* tag-20240917-01 */ _sqlite3VdbeMemSetInt64(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, iValue) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } @@ -65553,6 +65727,7 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { p = pStmt rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { + /* tag-20240917-01 */ Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } return rc @@ -65565,6 +65740,7 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, p = pStmt rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { + /* tag-20240917-01 */ _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { @@ -65629,6 +65805,7 @@ func Xsqlite3_bind_zeroblob(tls *libc.TLS, pStmt uintptr, i int32, n int32) (r i p = pStmt rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { + /* tag-20240917-01 */ _sqlite3VdbeMemSetZeroBlob(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, n) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } @@ -65993,53 +66170,89 @@ func _vdbeUnpackRecord(tls *libc.TLS, pKeyInfo uintptr, nKey int32, pKey uintptr // ** a field of the row currently being updated or deleted. // */ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) (r int32) { - var aRec, p, pMem, v1 uintptr + bp := tls.Alloc(16) + defer tls.Free(16) + var aRec, p, pCol, pDflt, pMem, v1, v2 uintptr + var iStore, nByte, rc int32 var nRec Tu32 - var rc int32 - _, _, _, _, _, _ = aRec, nRec, p, pMem, rc, v1 + var _ /* pVal at bp+0 */ uintptr + _, _, _, _, _, _, _, _, _, _, _ = aRec, iStore, nByte, nRec, p, pCol, pDflt, pMem, rc, v1, v2 rc = SQLITE_OK + iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92549)) + rc = _sqlite3MisuseError(tls, int32(92850)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iIdx = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + } else { + iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } - if iIdx >= int32((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField) || iIdx < 0 { + if iStore >= int32((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField) || iStore < 0 { rc = int32(SQLITE_RANGE) goto preupdate_old_out } - /* If the old.* record has not yet been loaded into memory, do so now. */ - if (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked == uintptr(0) { - nRec = _sqlite3BtreePayloadSize(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48))) - aRec = _sqlite3DbMallocRaw(tls, db, uint64(nRec)) - if !(aRec != 0) { - goto preupdate_old_out - } - rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) - if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) - if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { - rc = int32(SQLITE_NOMEM) - } - } - if rc != SQLITE_OK { - _sqlite3DbFree(tls, db, aRec) - goto preupdate_old_out - } - (*TPreUpdate)(unsafe.Pointer(p)).FaRecord = aRec - } - v1 = (*TUnpackedRecord)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FaMem + uintptr(iIdx)*56 - *(*uintptr)(unsafe.Pointer(ppValue)) = v1 - pMem = v1 if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { + v1 = p + 112 + pMem = v1 + *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) } else { - if iIdx >= libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FnField) { - *(*uintptr)(unsafe.Pointer(ppValue)) = _columnNullValue(tls) + /* If the old.* record has not yet been loaded into memory, do so now. */ + if (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked == uintptr(0) { + nRec = _sqlite3BtreePayloadSize(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48))) + aRec = _sqlite3DbMallocRaw(tls, db, uint64(nRec)) + if !(aRec != 0) { + goto preupdate_old_out + } + rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) + if rc == SQLITE_OK { + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc != SQLITE_OK { + _sqlite3DbFree(tls, db, aRec) + goto preupdate_old_out + } + (*TPreUpdate)(unsafe.Pointer(p)).FaRecord = aRec + } + v2 = (*TUnpackedRecord)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FaMem + uintptr(iStore)*56 + *(*uintptr)(unsafe.Pointer(ppValue)) = v2 + pMem = v2 + if iStore >= libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked)).FnField) { + /* This occurs when the table has been extended using ALTER TABLE + ** ADD COLUMN. The value to return is the default value of the column. */ + pCol = (*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FaCol + uintptr(iIdx)*16 + if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { + if (*TPreUpdate)(unsafe.Pointer(p)).FapDflt == uintptr(0) { + nByte = libc.Int32FromUint64(uint64(8) * libc.Uint64FromInt16((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FnCol)) + (*TPreUpdate)(unsafe.Pointer(p)).FapDflt = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + if (*TPreUpdate)(unsafe.Pointer(p)).FapDflt == uintptr(0) { + goto preupdate_old_out + } + } + if *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) == uintptr(0) { + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + pDflt = (*(*TExprList_item)(unsafe.Pointer((*(*struct { + FaddColOffset int32 + FpFKey uintptr + FpDfltList uintptr + })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr + rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, (*TColumn)(unsafe.Pointer(pCol)).Faffinity, bp) + if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { + rc = _sqlite3CorruptError(tls, int32(92907)) + } + *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) + } + *(*uintptr)(unsafe.Pointer(ppValue)) = *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) + } else { + *(*uintptr)(unsafe.Pointer(ppValue)) = _columnNullValue(tls) + } } else { if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FaCol + uintptr(iIdx)*16))).Faffinity) == int32(SQLITE_AFF_REAL) { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { @@ -66126,19 +66339,22 @@ func Xsqlite3_preupdate_blobwrite(tls *libc.TLS, db uintptr) (r int32) { // ** a field of the row currently being updated or inserted. // */ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintptr) (r int32) { + var iStore, rc, v1 int32 var p, pData, pMem, pUnpack uintptr - var rc, v1 int32 - _, _, _, _, _, _ = p, pData, pMem, pUnpack, rc, v1 + _, _, _, _, _, _, _ = iStore, p, pData, pMem, pUnpack, rc, v1 rc = SQLITE_OK + iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(92672)) + rc = _sqlite3MisuseError(tls, int32(93003)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iIdx = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + } else { + iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } - if iIdx >= int32((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField) || iIdx < 0 { + if iStore >= int32((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField) || iStore < 0 { rc = int32(SQLITE_RANGE) goto preupdate_new_out } @@ -66164,16 +66380,16 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } (*TPreUpdate)(unsafe.Pointer(p)).FpNewUnpacked = pUnpack } - pMem = (*TUnpackedRecord)(unsafe.Pointer(pUnpack)).FaMem + uintptr(iIdx)*56 + pMem = (*TUnpackedRecord)(unsafe.Pointer(pUnpack)).FaMem + uintptr(iStore)*56 if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey2) } else { - if iIdx >= libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pUnpack)).FnField) { + if iStore >= libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pUnpack)).FnField) { pMem = _columnNullValue(tls) } } } else { - /* For an UPDATE, memory cell (p->iNewReg+1+iIdx) contains the required + /* For an UPDATE, memory cell (p->iNewReg+1+iStore) contains the required ** value. Make a copy of the cell contents and return a pointer to it. ** It is not safe to return a pointer to the memory cell itself as the ** caller may modify the value text encoding. @@ -66185,12 +66401,12 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_new_out } } - pMem = (*TPreUpdate)(unsafe.Pointer(p)).FaNew + uintptr(iIdx)*56 + pMem = (*TPreUpdate)(unsafe.Pointer(p)).FaNew + uintptr(iStore)*56 if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags) == 0 { if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey2) } else { - rc = _sqlite3VdbeMemCopy(tls, pMem, (*TVdbe)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).Fv)).FaMem+uintptr((*TPreUpdate)(unsafe.Pointer(p)).FiNewReg+int32(1)+iIdx)*56) + rc = _sqlite3VdbeMemCopy(tls, pMem, (*TVdbe)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).Fv)).FaMem+uintptr((*TPreUpdate)(unsafe.Pointer(p)).FiNewReg+int32(1)+iStore)*56) if rc != SQLITE_OK { goto preupdate_new_out } @@ -66306,7 +66522,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5610, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5627, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -66338,13 +66554,13 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr nextIndex = v2 pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))*56 if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1663, int32(4)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1664, int32(4)) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1423, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1424, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5131, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5132, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -66359,28 +66575,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5614, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5631, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5621, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5638, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5634, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5651, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5637, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5654, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5642, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5659, int32(1)) } } } @@ -66421,6 +66637,10 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr /* #include "vdbeInt.h" */ /* +** High-resolution hardware timer used for debugging and testing only. + */ + +/* ** Invoke this macro on memory cells just prior to changing the ** value of the cell. This macro verifies that shallow copies are ** not misused. A shallow copy of a string or blob just copies a @@ -66976,11 +67196,11 @@ func _vdbeMemTypeName(tls *libc.TLS, pMem uintptr) (r uintptr) { } var _azTypes = [5]uintptr{ - 0: __ccgo_ts + 1132, - 1: __ccgo_ts + 1144, - 2: __ccgo_ts + 1149, - 3: __ccgo_ts + 1127, - 4: __ccgo_ts + 1663, + 0: __ccgo_ts + 1133, + 1: __ccgo_ts + 1145, + 2: __ccgo_ts + 1150, + 3: __ccgo_ts + 1128, + 4: __ccgo_ts + 1664, } // C documentation @@ -66992,13 +67212,13 @@ var _azTypes = [5]uintptr{ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(976) defer tls.Free(976) - var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr + var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity uint8 var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 - var h, h1, iKey1, nData, nProgressLimit, nVmStep, offset64, uu Tu64 + var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 @@ -67051,7 +67271,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* z at bp+688 */ uintptr var _ /* zErr at bp+632 */ uintptr var _ /* zErr at bp+792 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aCol, aMem, aOffset, aOp, aPermute, aRoot, affinity, alreadyExists, apArg, apArg1, bRev, c, c1, c2, cnt, cnt1, colCacheCtr, db, desiredAutoCommit, eNew, eOld, encoding, eqOnly, exists, flags1, flags11, flags2, flags3, flags31, h, h1, i, i1, i2, i3, i4, i5, i6, i7, i8, i9, iA, iAddr, iB1, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iKey, iKey1, iKey2, iMap, iPrior, iQuery, iRollback, iSavepoint, iSet, idx, ii, ii1, isLegacy, isSchemaChange, isTransaction, isWriteLock, len1, len11, mTrace, n, n1, n2, n3, n4, nArg, nArg1, nByte, nByte1, nByte2, nCellKey, nData, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nProgressLimit, nRoot, nStep, nVarint, nVmStep, nZero, newMax, newType, nullFlag, oc, offset64, op, opflags, p1, p11, p12, p13, p2, p21, p22, p23, p5, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pcDest, pcx, pnErr, rA, rB, rc, res, res10, res11, res12, res21, resetSchemaOnFault, savedAnalysisLimit, seekResult, serialType, serial_type, sz, t1, type1, type2, typeMask, uu, v11, v21, vtabOnConflict, wrFlag, xAuth, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v188, v190, v191, v194, v197, v198, v204, v205, v206, v207, v211, v213, v214, v215, v216, v221, v222, v223, v224, v225, v240, v241, v242, v244, v245, v248, v249, v250, v251, v252, v253, v254, v255, v256, v260, v262, v263, v265, v266, v267, v269, v270, v271, v272, v273, v274, v275, v278, v279, v281, v282, v284, v286, v287, v288, v291, v297, v298, v299, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aCol, aMem, aOffset, aOp, aPermute, aRoot, affinity, alreadyExists, apArg, apArg1, bRev, c, c1, c2, cnt, cnt1, colCacheCtr, db, desiredAutoCommit, eNew, eOld, encoding, eqOnly, exists, flags1, flags11, flags2, flags3, flags31, h, h1, i, i1, i2, i3, i4, i5, i6, i7, i8, i9, iA, iAddr, iB1, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iKey, iKey1, iKey2, iMap, iPrior, iQuery, iRollback, iSavepoint, iSet, idx, ii, ii1, isLegacy, isSchemaChange, isTransaction, isWriteLock, len1, len11, mTrace, n, n1, n2, n3, n4, nAlloc, nArg, nArg1, nByte, nByte1, nByte2, nCellKey, nData, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nProgressLimit, nRoot, nStep, nVarint, nVmStep, nZero, newMax, newType, nullFlag, oc, offset64, op, opflags, p1, p11, p12, p13, p2, p21, p22, p23, p5, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pcDest, pcx, pnErr, rA, rB, rc, res, res10, res11, res12, res21, resetSchemaOnFault, savedAnalysisLimit, seekResult, serialType, serial_type, sz, t1, type1, type2, typeMask, uu, v11, v21, vtabOnConflict, wrFlag, xAuth, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v188, v190, v191, v194, v197, v198, v204, v205, v206, v207, v211, v213, v214, v215, v216, v221, v222, v223, v224, v225, v240, v241, v242, v244, v245, v248, v249, v250, v251, v252, v253, v254, v255, v256, v260, v262, v263, v265, v266, v267, v269, v270, v271, v272, v273, v274, v275, v278, v279, v281, v282, v284, v286, v287, v288, v291, v297, v298, v299, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 aOp = (*TVdbe)(unsafe.Pointer(p)).FaOp /* Copy of p->aOp */ pOp = aOp /* Current operation */ rc = SQLITE_OK /* Value to return */ @@ -67683,7 +67903,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pIn3)).Fflags)&int32(MEM_Null) == 0 { goto _187 } - /* Opcode: Halt P1 P2 * P4 P5 + /* Fall through into OP_Halt */ + /* Opcode: Halt P1 P2 P3 P4 P5 ** ** Exit immediately. All open cursors, etc are closed ** automatically. @@ -67696,18 +67917,22 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** then back out all changes that have occurred during this execution of the ** VDBE, but do not rollback the transaction. ** - ** If P4 is not null then it is an error message string. + ** If P3 is not zero and P4 is NULL, then P3 is a register that holds the + ** text of an error message. ** - ** P5 is a value between 0 and 4, inclusive, that modifies the P4 string. + ** If P3 is zero and P4 is not null then the error message string is held + ** in P4. + ** + ** P5 is a value between 1 and 4, inclusive, then the P4 error message + ** string is modified as follows: ** - ** 0: (no change) ** 1: NOT NULL constraint failed: P4 ** 2: UNIQUE constraint failed: P4 ** 3: CHECK constraint failed: P4 ** 4: FOREIGN KEY constraint failed: P4 ** - ** If P5 is not zero and P4 is NULL, then everything after the ":" is - ** omitted. + ** If P3 is zero and P5 is not zero and P4 is NULL, then everything after + ** the ":" is omitted. ** ** There is an implied "Halt 0 0 0" instruction inserted at the very end of ** every program. So a jump past the last instruction of the program @@ -67741,16 +67966,21 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbe)(unsafe.Pointer(p)).Frc = (*TOp)(unsafe.Pointer(pOp)).Fp1 (*TVdbe)(unsafe.Pointer(p)).FerrorAction = libc.Uint8FromInt32((*TOp)(unsafe.Pointer(pOp)).Fp2) if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { - if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5678, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) - if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5699, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) - } + if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { + zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, zErr)) } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3859, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { + _sqlite3VdbeError(tls, p, __ccgo_ts+5695, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5716, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + } + } else { + _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5706, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5723, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -67831,6 +68061,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto too_big } (*TOp)(unsafe.Pointer(pOp)).Fopcode = uint8(OP_String) + /* Fall through to the next case, OP_String */ /* Opcode: String P1 P2 P3 P4 P5 ** Synopsis: r[P2]='P4' (len=P1) ** @@ -69472,7 +69703,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96313)) + rc = _sqlite3CorruptError(tls, int32(96760)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -69575,7 +69806,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5730, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5747, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) goto abort_due_to_error /* Opcode: Affinity P1 P2 * P4 * @@ -69981,7 +70212,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* A new savepoint cannot be created if there are active write ** statements (i.e. open read/write incremental blob handles). */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5771, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5788, 0) rc = int32(SQLITE_BUSY) } else { nName = _sqlite3Strlen30(tls, zName) @@ -70029,14 +70260,14 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pSavepoint = (*TSavepoint)(unsafe.Pointer(pSavepoint)).FpNext } if !(pSavepoint != 0) { - _sqlite3VdbeError(tls, p, __ccgo_ts+5822, libc.VaList(bp+944, zName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5839, libc.VaList(bp+944, zName)) rc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeWrite > 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5844, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5861, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -70171,7 +70402,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5898, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5915, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -70201,12 +70432,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5953 + v250 = __ccgo_ts + 5970 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6001 + v251 = __ccgo_ts + 6018 } else { - v251 = __ccgo_ts + 6044 + v251 = __ccgo_ts + 6061 } v250 = v251 } @@ -70298,7 +70529,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6085) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6102) /* 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. @@ -70500,18 +70731,18 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb2)).FpSchema)).Ffile_format) < libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FminWriteFileFormat) { (*TVdbe)(unsafe.Pointer(p)).FminWriteFileFormat = (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb2)).FpSchema)).Ffile_format } + if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_P2ISREG) != 0 { + pIn2 = aMem + uintptr(p23)*56 + _sqlite3VdbeMemIntegerify(tls, pIn2) + p23 = libc.Uint32FromInt32(int32(*(*Ti64)(unsafe.Pointer(pIn2)))) + /* The p2 value always comes from a prior OP_CreateBtree opcode and + ** that opcode will always set the p2 value to 2 or more or else fail. + ** If there were a failure, the prepared statement would have halted + ** before reaching this instruction. */ + } } else { wrFlag = 0 } - if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_P2ISREG) != 0 { - pIn2 = aMem + uintptr(p23)*56 - _sqlite3VdbeMemIntegerify(tls, pIn2) - p23 = libc.Uint32FromInt32(int32(*(*Ti64)(unsafe.Pointer(pIn2)))) - /* The p2 value always comes from a prior OP_CreateBtree opcode and - ** that opcode will always set the p2 value to 2 or more or else fail. - ** If there were a failure, the prepared statement would have halted - ** before reaching this instruction. */ - } if int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == -int32(8) { pKeyInfo1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) nField1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnAllField) @@ -70616,7 +70847,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** form sqlite3BtreeInsert() where the length of the data is zero. */ /* Only used when number of columns is zero */ (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fn = 0 - (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1662 + (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1663 } pCx1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) if pCx1 != 0 && !(int32(TBool(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3)) != 0) && (*TOp)(unsafe.Pointer(pOp)).Fp2 <= int32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FnField) { @@ -70660,6 +70891,8 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { libc.SetBitFieldPtr8Uint32(pCx1+8, libc.BoolUint32(libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) != libc.Int32FromInt32(BTREE_UNORDERED)), 2, 0x4) if rc != 0 { _sqlite3BtreeClose(tls, *(*uintptr)(unsafe.Pointer(pCx1 + 16))) + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) = uintptr(0) /* Not required; helps with static analysis */ + } else { } } } @@ -71245,6 +71478,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if libc.Int32FromUint16((*TVdbeCursor)(unsafe.Pointer(pC8)).FseekHit) >= (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi { goto _187 } + /* Fall through into OP_NotFound */ _95: ; /* jump, in3, ncycle */ _94: @@ -71387,6 +71621,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { iKey1 = libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp + 256))) goto notExistsWithKey } + /* Fall through into OP_NotExists */ _96: ; /* jump, in3, ncycle */ pIn3 = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 @@ -71405,7 +71640,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(98567)) + rc = _sqlite3CorruptError(tls, int32(99020)) } else { goto jump_to_p2 } @@ -72058,6 +72293,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _112: ; /* jump ncycle */ *(*Tu32)(unsafe.Pointer(p + 212 + 2*4))++ + /* Fall through into OP_Rewind */ /* Opcode: Rewind P1 P2 * * * ** ** The next use of the Rowid or Column or Next instruction for P1 @@ -72296,7 +72532,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)<<libc.Int32FromInt32(8), int32(99659), __ccgo_ts+6113) + rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)<<libc.Int32FromInt32(8), int32(100112), __ccgo_ts+6130) goto abort_due_to_error } } @@ -72451,7 +72687,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* nCellKey will always be between 0 and 0xffffffff because of the way ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(99864)) + rc = _sqlite3CorruptError(tls, int32(100317)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -72626,7 +72862,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3859, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -72657,13 +72893,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6130 + zSchema = __ccgo_ts + 6147 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6144, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6161, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -72678,7 +72914,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* 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 = _sqlite3CorruptError(tls, int32(100157)) + rc = _sqlite3CorruptError(tls, int32(100610)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -72915,7 +73151,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6187, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6204, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73230,24 +73466,33 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _151: ; n4 = libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) - pCtx = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(n4)*uint64(8)+(libc.Uint64FromInt64(56)+libc.Uint64FromInt64(56)-libc.Uint64FromInt64(8))) + /* Allocate space for (a) the context object and (n-1) extra pointers + ** to append to the sqlite3_context.argv[1] array, and (b) a memory + ** cell in which to store the accumulation. Be careful that the memory + ** cell is 8-byte aligned, even on platforms where a pointer is 32-bits. + ** + ** Note: We could avoid this by using a regular memory cell from aMem[] for + ** the accumulator, instead of allocating one here. */ + nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem } - (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpMem = uintptr(0) - (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut = pCtx + 48 + uintptr(n4)*8 + (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut = pCtx + uintptr(nAlloc) _sqlite3VdbeMemInit(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, db, uint16(MEM_Null)) + (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpMem = uintptr(0) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc = *(*uintptr)(unsafe.Pointer(pOp + 16)) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp = int32((int64(pOp) - int64(aOp)) / 24) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe = p (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FskipFlag = uint8(0) (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = 0 (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fenc = encoding - (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = libc.Uint8FromInt32(n4) + (*Tsqlite3_context)(unsafe.Pointer(pCtx)).Fargc = libc.Uint16FromInt32(n4) (*TOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(15)) *(*uintptr)(unsafe.Pointer(pOp + 16)) = pCtx /* OP_AggInverse must have P1==1 and OP_AggStep must have P1==0 */ (*TOp)(unsafe.Pointer(pOp)).Fopcode = uint8(OP_AggStep1) + /* Fall through into OP_AggStep */ _153: ; pCtx1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) @@ -73258,7 +73503,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** reinitializes the relevant parts of the sqlite3_context object */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpMem != pMem2 { (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpMem = pMem2 - i4 = libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc) - int32(1) + i4 = libc.Int32FromUint16((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc) - int32(1) for { if !(i4 >= 0) { break @@ -73272,13 +73517,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } (*TMem)(unsafe.Pointer(pMem2)).Fn++ if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxInverse})))(tls, pCtx1, libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48) + (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxInverse})))(tls, pCtx1, libc.Int32FromUint16((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48) } else { - (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxSFunc})))(tls, pCtx1, libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48) + (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpFunc)).FxSFunc})))(tls, pCtx1, libc.Int32FromUint16((*Tsqlite3_context)(unsafe.Pointer(pCtx1)).Fargc), pCtx1+48) } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3859, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -73334,7 +73579,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3859, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -73413,11 +73658,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6224 + v286 = __ccgo_ts + 6241 } else { - v286 = __ccgo_ts + 6229 + v286 = __ccgo_ts + 6246 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6236, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6253, libc.VaList(bp+944, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -73570,7 +73815,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6288, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6305, libc.VaList(bp+944, z1)) } goto abort_due_to_error } @@ -73732,7 +73977,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6317, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6334, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -73828,7 +74073,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3859, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74065,7 +74310,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FpVdbe = p (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FpOut = pOut (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).Fenc = encoding - i8 = libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).Fargc) - int32(1) + i8 = libc.Int32FromUint16((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).Fargc) - int32(1) for { if !(i8 >= 0) { break @@ -74078,11 +74323,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } (*TMem)(unsafe.Pointer(pOut)).Fflags = libc.Uint16FromInt32(libc.Int32FromUint16((*TMem)(unsafe.Pointer(pOut)).Fflags) & ^(libc.Int32FromInt32(MEM_TypeMask)|libc.Int32FromInt32(MEM_Zero)) | int32(MEM_Null)) - (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FpFunc)).FxSFunc})))(tls, pCtx2, libc.Int32FromUint8((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).Fargc), pCtx2+48) /* IMP: R-24505-23230 */ + (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FpFunc)).FxSFunc})))(tls, pCtx2, libc.Int32FromUint16((*Tsqlite3_context)(unsafe.Pointer(pCtx2)).Fargc), pCtx2+48) /* IMP: R-24505-23230 */ /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3859, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -74233,7 +74478,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6327, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6344, libc.VaList(bp+944, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -74265,14 +74510,29 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto jump_to_p2 /* Opcode: Noop * * * * * ** - ** Do nothing. This instruction is often useful as a jump - ** destination. + ** Do nothing. Continue downward to the next opcode. */ - /* - ** The magic Explain opcode are only inserted when explain==2 (which - ** 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. + /* Opcode: Explain P1 P2 P3 P4 * + ** + ** This is the same as OP_Noop during normal query execution. The + ** purpose of this opcode is to hold information about the query + ** plan for the purpose of EXPLAIN QUERY PLAN output. + ** + ** The P4 value is human-readable text that describes the query plan + ** element. Something like "SCAN t1" or "SEARCH t2 USING INDEX t2x1". + ** + ** The P1 value is the ID of the current element and P2 is the parent + ** element for the case of nested query plan elements. If P2 is zero + ** then this element is a top-level element. + ** + ** For loop elements, P3 is the estimated code of each invocation of this + ** element. + ** + ** As with all opcodes, the meanings of the parameters for OP_Explain + ** are subject to change from one release to the next. Applications + ** should not attempt to interpret or use any of the information + ** contained in the OP_Explain opcode. The information provided by this + ** opcode is intended for testing and debugging use only. */ _186: ; /* This is really OP_Noop, OP_Explain */ @@ -74305,15 +74565,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<<libc.Int32FromInt32(8) { - rc = _sqlite3CorruptError(tls, int32(102189)) + rc = _sqlite3CorruptError(tls, int32(102668)) } } if (*TVdbe)(unsafe.Pointer(p)).FzErrMsg == uintptr(0) && rc != libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) { - _sqlite3VdbeError(tls, p, __ccgo_ts+3859, libc.VaList(bp+944, _sqlite3ErrStr(tls, rc))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, _sqlite3ErrStr(tls, rc))) } (*TVdbe)(unsafe.Pointer(p)).Frc = rc _sqlite3SystemError(tls, db, rc) - Xsqlite3_log(tls, rc, __ccgo_ts+6333, libc.VaList(bp+944, int32((int64(pOp)-int64(aOp))/24), (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, rc, __ccgo_ts+6350, libc.VaList(bp+944, int32((int64(pOp)-int64(aOp))/24), (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) == int32(VDBE_RUN_STATE) { _sqlite3VdbeHalt(tls, p) } @@ -74352,7 +74612,7 @@ vdbe_return: goto too_big too_big: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5487, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5504, 0) rc = int32(SQLITE_TOOBIG) goto abort_due_to_error /* Jump to here if a malloc() fails. @@ -74361,7 +74621,7 @@ too_big: no_mem: ; _sqlite3OomFault(tls, db) - _sqlite3VdbeError(tls, p, __ccgo_ts+1632, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+1633, 0) rc = int32(SQLITE_NOMEM) goto abort_due_to_error /* Jump to here if the sqlite3_interrupt() API sets the interrupt @@ -74376,10 +74636,10 @@ abort_due_to_interrupt: } var _azType = [4]uintptr{ - 0: __ccgo_ts + 5644, - 1: __ccgo_ts + 5653, - 2: __ccgo_ts + 5660, - 3: __ccgo_ts + 5666, + 0: __ccgo_ts + 5661, + 1: __ccgo_ts + 5670, + 2: __ccgo_ts + 5677, + 3: __ccgo_ts + 5683, } var _and_logic = [9]uint8{ @@ -74530,16 +74790,16 @@ func _blobSeekToRow(tls *libc.TLS, p uintptr, iRow Tsqlite3_int64, pzErr uintptr type1 = v1 if type1 < uint32(12) { if type1 == uint32(0) { - v2 = __ccgo_ts + 1648 + v2 = __ccgo_ts + 1649 } else { if type1 == uint32(7) { - v3 = __ccgo_ts + 6365 + v3 = __ccgo_ts + 6382 } else { - v3 = __ccgo_ts + 6370 + v3 = __ccgo_ts + 6387 } v2 = v3 } - zErr = _sqlite3MPrintf(tls, (*TIncrblob)(unsafe.Pointer(p)).Fdb, __ccgo_ts+6378, libc.VaList(bp+8, v2)) + zErr = _sqlite3MPrintf(tls, (*TIncrblob)(unsafe.Pointer(p)).Fdb, __ccgo_ts+6395, libc.VaList(bp+8, v2)) rc = int32(SQLITE_ERROR) Xsqlite3_finalize(tls, (*TIncrblob)(unsafe.Pointer(p)).FpStmt) (*TIncrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0) @@ -74557,10 +74817,10 @@ func _blobSeekToRow(tls *libc.TLS, p uintptr, iRow Tsqlite3_int64, pzErr uintptr rc = Xsqlite3_finalize(tls, (*TIncrblob)(unsafe.Pointer(p)).FpStmt) (*TIncrblob)(unsafe.Pointer(p)).FpStmt = uintptr(0) if rc == SQLITE_OK { - zErr = _sqlite3MPrintf(tls, (*TIncrblob)(unsafe.Pointer(p)).Fdb, __ccgo_ts+6407, libc.VaList(bp+8, iRow)) + zErr = _sqlite3MPrintf(tls, (*TIncrblob)(unsafe.Pointer(p)).Fdb, __ccgo_ts+6424, libc.VaList(bp+8, iRow)) rc = int32(SQLITE_ERROR) } else { - zErr = _sqlite3MPrintf(tls, (*TIncrblob)(unsafe.Pointer(p)).Fdb, __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_errmsg(tls, (*TIncrblob)(unsafe.Pointer(p)).Fdb))) + zErr = _sqlite3MPrintf(tls, (*TIncrblob)(unsafe.Pointer(p)).Fdb, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, (*TIncrblob)(unsafe.Pointer(p)).Fdb))) } } } @@ -74600,15 +74860,19 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, pTab = _sqlite3LocateTable(tls, bp+8, uint32(0), zTable, zDb) if pTab != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { pTab = uintptr(0) - _sqlite3ErrorMsg(tls, bp+8, __ccgo_ts+6427, libc.VaList(bp+440, zTable)) + _sqlite3ErrorMsg(tls, bp+8, __ccgo_ts+6444, libc.VaList(bp+440, zTable)) } if pTab != 0 && !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { pTab = uintptr(0) - _sqlite3ErrorMsg(tls, bp+8, __ccgo_ts+6457, libc.VaList(bp+440, zTable)) + _sqlite3ErrorMsg(tls, bp+8, __ccgo_ts+6474, libc.VaList(bp+440, zTable)) + } + if pTab != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasGenerated) != uint32(0) { + pTab = uintptr(0) + _sqlite3ErrorMsg(tls, bp+8, __ccgo_ts+6510, libc.VaList(bp+440, zTable)) } if pTab != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { pTab = uintptr(0) - _sqlite3ErrorMsg(tls, bp+8, __ccgo_ts+6493, libc.VaList(bp+440, zTable)) + _sqlite3ErrorMsg(tls, bp+8, __ccgo_ts+6555, libc.VaList(bp+440, zTable)) } if !(pTab != 0) { if (*(*TParse)(unsafe.Pointer(bp + 8))).FzErrMsg != 0 { @@ -74638,7 +74902,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+6514, libc.VaList(bp+440, zColumn)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+6576, libc.VaList(bp+440, zColumn)) rc = int32(SQLITE_ERROR) _sqlite3BtreeLeaveAll(tls, db) goto blob_open_out @@ -74664,7 +74928,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, break } if (*(*TsColMap)(unsafe.Pointer(pFKey + 64 + uintptr(j)*16))).FiFrom == iCol { - zFault = __ccgo_ts + 6535 + zFault = __ccgo_ts + 6597 } goto _3 _3: @@ -74689,7 +74953,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } /* FIXME: Be smarter about indexes that use expressions */ if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == iCol || int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j1)*2))) == -int32(2) { - zFault = __ccgo_ts + 6547 + zFault = __ccgo_ts + 6609 } goto _5 _5: @@ -74703,7 +74967,7 @@ func Xsqlite3_blob_open(tls *libc.TLS, db uintptr, zDb uintptr, zTable uintptr, } if zFault != 0 { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+6555, libc.VaList(bp+440, zFault)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+6617, libc.VaList(bp+440, zFault)) rc = int32(SQLITE_ERROR) _sqlite3BtreeLeaveAll(tls, db) goto blob_open_out @@ -74775,7 +75039,7 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3859 + v7 = __ccgo_ts + 3860 } else { v7 = libc.UintptrFromInt32(0) } @@ -74865,7 +75129,7 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(102673)) + return _sqlite3MisuseError(tls, int32(103157)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -74964,7 +75228,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(102773)) + return _sqlite3MisuseError(tls, int32(103257)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -74978,7 +75242,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3859 + v1 = __ccgo_ts + 3860 } else { v1 = libc.UintptrFromInt32(0) } @@ -75638,7 +75902,8 @@ func _vdbePmaReadBlob(tls *libc.TLS, p uintptr, nByte int32, ppOut uintptr) (r i nRem = nByte - nAvail /* The following loop copies up to p->nBuffer bytes per iteration into ** the p->aAlloc[] buffer. */ - for nRem > 0 { /* Pointer to buffer to copy data from */ + for nRem > 0 { /* Number of bytes to copy */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Pointer to buffer to copy data from */ nCopy = nRem if nRem > (*TPmaReader)(unsafe.Pointer(p)).FnBuffer { nCopy = (*TPmaReader)(unsafe.Pointer(p)).FnBuffer @@ -78727,17 +78992,17 @@ func _sqlite3WalkSelectFrom(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) if !(i > 0) { break } - if (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 && _sqlite3WalkSelect(tls, pWalker, (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 && _sqlite3WalkSelect(tls, pWalker, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect) != 0 { return int32(WRC_Abort) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x4>>2)) != 0 && _sqlite3WalkExprList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pItem + 88))) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x8>>3) != 0 && _sqlite3WalkExprList(tls, pWalker, *(*uintptr)(unsafe.Pointer(pItem + 48))) != 0 { return int32(WRC_Abort) } goto _1 _1: ; i-- - pItem += 104 + pItem += 80 } } return WRC_Continue @@ -79080,7 +79345,7 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt if pNew != 0 { (*TExpr)(unsafe.Pointer(pNew)).FiTable = (*TSrcItem)(unsafe.Pointer(pMatch)).FiCursor (*TExpr)(unsafe.Pointer(pNew)).FiColumn = iColumn - *(*uintptr)(unsafe.Pointer(pNew + 64)) = (*TSrcItem)(unsafe.Pointer(pMatch)).FpTab + *(*uintptr)(unsafe.Pointer(pNew + 64)) = (*TSrcItem)(unsafe.Pointer(pMatch)).FpSTab *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) *(*uintptr)(unsafe.Pointer(ppList)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(ppList)), pNew) } @@ -79094,25 +79359,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6589, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6651, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6597+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6616+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6659+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6678+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6130+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6147+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6635+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6697+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6635+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6697+7) == 0 { return int32(1) } } @@ -79152,22 +79417,22 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh bp := tls.Alloc(64) defer tls.Free(64) var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr + var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr var hCol, hCol1 Tu8 var v7, v8 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* A column of pTab */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -79199,7 +79464,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6649, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6711, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -79217,8 +79482,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if !(i < (*TSrcList)(unsafe.Pointer(pSrcList)).FnSrc) { break } - pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2000>>13)) != 0 { + pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { /* In this case, pItem is a subquery that has been formed from a ** parenthesized subset of the FROM clause terms. Example: ** .... FROM t1 LEFT JOIN (t2 RIGHT JOIN t3 USING(x)) USING(y) ... @@ -79226,7 +79491,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** This pItem -------------^ */ hit = 0 - pEList = (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpEList + pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect + pEList = (*TSelect)(unsafe.Pointer(pSel)).FpEList j = 0 for { if !(j < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { @@ -79238,7 +79504,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if *(*int32)(unsafe.Pointer(bp + 8)) == 0 { if cnt > 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x400>>10)) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 72)), zCol) < 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { /* Two or more tables have the same column name which is ** not joined by USING. This is an error. Signal as much ** by clearing pFJMatch and letting cnt go above 1. */ @@ -79292,7 +79558,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6654) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6716) != 0 { goto _2 } } @@ -79323,7 +79589,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { if cnt > 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x400>>10)) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 72)), zCol) < 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { /* Two or more tables have the same column name which is ** not joined by USING. This is an error. Signal as much ** by clearing pFJMatch and letting cnt go above 1. */ @@ -79355,7 +79621,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh v5 = int32(int16(j)) } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2000>>13)) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { _sqlite3SrcItemColumnUsed(tls, pItem, j) } break @@ -79383,11 +79649,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _2: ; i++ - pItem += 104 + pItem += 80 } if pMatch != 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TSrcItem)(unsafe.Pointer(pMatch)).FiCursor - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TSrcItem)(unsafe.Pointer(pMatch)).FpTab + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TSrcItem)(unsafe.Pointer(pMatch)).FpSTab if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pMatch)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0 { *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } @@ -79409,11 +79675,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6656, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6718, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6660, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6722, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -79422,8 +79688,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6664, zTab) == 0 { - pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpTab + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6726, zTab) == 0 { + pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } @@ -79502,9 +79768,9 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh /* ** Perhaps the name is a reference to the ROWID */ - if cnt == 0 && cntTab >= int32(1) && pMatch != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) == 0 && _sqlite3IsRowid(tls, zCol) != 0 && ((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pMatch)).FpTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) || int32(uint32(*(*uint16)(unsafe.Pointer(pMatch + 60 + 4))&0x2000>>13)) != 0) { + if cnt == 0 && cntTab >= int32(1) && pMatch != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) == 0 && _sqlite3IsRowid(tls, zCol) != 0 && ((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pMatch)).FpSTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) || int32(*(*uint32)(unsafe.Pointer(pMatch + 24 + 4))&0x4000>>14) != 0) { cnt = cntTab - if int32(uint32(*(*uint16)(unsafe.Pointer(pMatch + 60 + 4))&0x2000>>13)) == 0 { + if int32(*(*uint32)(unsafe.Pointer(pMatch + 24 + 4))&0x4000>>14) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(-int32(1)) } (*TExpr)(unsafe.Pointer(pExpr)).FaffExpr = uint8(SQLITE_AFF_INTEGER) @@ -79538,15 +79804,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6673, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6735, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6704, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6766, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6741, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -79598,7 +79864,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6759, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6821, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+64, 0, uint64(8)) return int32(WRC_Prune) @@ -79627,7 +79893,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6794 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6856 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -79637,21 +79903,21 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6803 + v10 = __ccgo_ts + 6865 } else { - v10 = __ccgo_ts + 6818 + v10 = __ccgo_ts + 6880 } zErr = v10 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6840, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6902, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6853, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6863, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6925, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6924, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6986, libc.VaList(bp+24, zErr, zCol)) } } } @@ -79684,9 +79950,9 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh */ if pMatch != 0 { if int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { - *(*TBitmask)(unsafe.Pointer(pMatch + 80)) |= _sqlite3ExprColUsed(tls, pExpr) + *(*TBitmask)(unsafe.Pointer(pMatch + 40)) |= _sqlite3ExprColUsed(tls, pExpr) } else { - libc.SetBitFieldPtr16Uint32(pMatch+60+4, libc.Uint32FromInt32(1), 14, 0x4000) + libc.SetBitFieldPtr32Uint32(pMatch+24+4, libc.Uint32FromInt32(1), 15, 0x8000) } } (*TExpr)(unsafe.Pointer(pExpr)).Fop = libc.Uint8FromInt32(eNewExprOp) @@ -79728,8 +79994,8 @@ func _sqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int3 _, _, _, _, _, _ = p, pItem, pTab, v1, v2, v3 p = _sqlite3ExprAlloc(tls, db, int32(TK_COLUMN), uintptr(0), 0) if p != 0 { - pItem = pSrc + 8 + uintptr(iSrc)*104 - v1 = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab + pItem = pSrc + 8 + uintptr(iSrc)*80 + v1 = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab *(*uintptr)(unsafe.Pointer(p + 64)) = v1 pTab = v1 (*TExpr)(unsafe.Pointer(p)).FiTable = (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor @@ -79750,7 +80016,7 @@ func _sqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int3 } else { v3 = iCol } - *(*TBitmask)(unsafe.Pointer(pItem + 80)) |= libc.Uint64FromInt32(1) << v3 + *(*TBitmask)(unsafe.Pointer(pItem + 40)) |= libc.Uint64FromInt32(1) << v3 } } } @@ -79780,19 +80046,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 6931 + zIn = __ccgo_ts + 6993 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 6959 + zIn = __ccgo_ts + 7021 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 6977 + zIn = __ccgo_ts + 7039 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 6995 + zIn = __ccgo_ts + 7057 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7013, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7075, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -79838,10 +80104,10 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var anRef [8]int32 - var auth, i, is_agg, n, nLeft, nRef, nRight, no_such_func, rc, savedAllowFlags, wrong_num_args, v12, v4, v6, v7 int32 + var auth, i, ii, is_agg, n, nLeft, nRef, nRight, no_such_func, rc, savedAllowFlags, wrong_num_args, v13, v5, v6, v8 int32 var enc Tu8 - var p, pDef, pItem, pLeft, pList, pNC, pNC2, pParse, pRight, pRight1, pSel, pSrcList, pWin, zDb, zId, zTable, zType, v5, v8, p10, p11, p9 uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = anRef, auth, enc, i, is_agg, n, nLeft, nRef, nRight, no_such_func, p, pDef, pItem, pLeft, pList, pNC, pNC2, pParse, pRight, pRight1, pSel, pSrcList, pWin, rc, savedAllowFlags, wrong_num_args, zDb, zId, zTable, zType, v12, v4, v5, v6, v7, v8, p10, p11, p9 + var p, pDef, pItem, pLeft, pList, pNC, pNC2, pParse, pRight, pRight1, pSel, pSrcList, pWin, zDb, zId, zTable, zType, v4, v9, p10, p11, p12 uintptr + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = anRef, auth, enc, i, ii, is_agg, n, nLeft, nRef, nRight, no_such_func, p, pDef, pItem, pLeft, pList, pNC, pNC2, pParse, pRight, pRight1, pSel, pSrcList, pWin, rc, savedAllowFlags, wrong_num_args, zDb, zId, zTable, zType, v13, v4, v5, v6, v8, v9, p10, p11, p12 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) { @@ -79854,7 +80120,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList pItem = pSrcList + 8 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor (*TExpr)(unsafe.Pointer(pExpr)).FiColumn-- (*TExpr)(unsafe.Pointer(pExpr)).FaffExpr = uint8(SQLITE_AFF_INTEGER) @@ -79964,7 +80230,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7033, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7095, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -79984,25 +80250,25 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { /* Resolve function names */ fallthrough - case int32(TK_FUNCTION): - pList = *(*uintptr)(unsafe.Pointer(pExpr + 32)) - if pList != 0 { - v4 = (*TExprList)(unsafe.Pointer(pList)).FnExpr - } else { - v4 = 0 - } /* The argument list */ - n = v4 /* Number of arguments */ + case int32(TK_FUNCTION): /* Number of arguments */ no_such_func = 0 /* True if no such function exists */ wrong_num_args = 0 /* True if wrong number of arguments */ is_agg = 0 /* Information about the function */ enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc /* The database encoding */ savedAllowFlags = (*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_AllowAgg) | libc.Int32FromInt32(NC_AllowWin)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FeFrmType) != int32(TK_FILTER) { - v5 = *(*uintptr)(unsafe.Pointer(pExpr + 64)) + v4 = *(*uintptr)(unsafe.Pointer(pExpr + 64)) } else { - v5 = uintptr(0) + v4 = uintptr(0) } - pWin = v5 + pWin = v4 + pList = *(*uintptr)(unsafe.Pointer(pExpr + 32)) + if pList != 0 { + v5 = (*TExprList)(unsafe.Pointer(pList)).FnExpr + } else { + v5 = 0 + } + n = v5 zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zId, n, enc, uint8(0)) if pDef == uintptr(0) { @@ -80019,7 +80285,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7050, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7112, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80043,12 +80309,33 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7114, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) return int32(WRC_Prune) } + /* If the function may call sqlite3_value_subtype(), then set the + ** EP_SubtArg flag on all of its argument expressions. This prevents + ** where.c from replacing the expression with a value read from an + ** index on the same expression, which will not have the correct + ** subtype. Also set the flag if the function expression itself is + ** an EP_SubtArg expression. In this case subtypes are required as + ** the function may return a value with a subtype back to its + ** caller using sqlite3_result_value(). */ + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + ii = 0 + for { + if !(ii < n) { + break + } + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + goto _7 + _7: + ; + ii++ + } + } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)|libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG)) != 0 { /* For the purposes of the EP_ConstFunc flag, date and time ** functions and other functions that change slowly are considered @@ -80064,7 +80351,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all ** all this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7150, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7212, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ @@ -80088,29 +80375,29 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7178, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7240, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7221 + zType = __ccgo_ts + 7283 } else { - zType = __ccgo_ts + 7228 + zType = __ccgo_ts + 7290 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7238, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7300, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7266, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7328, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7288, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7350, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7332, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7394, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -80127,11 +80414,11 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** Or arguments of other window functions. But aggregate functions ** may be arguments for window functions. */ if !(pWin != 0) { - v7 = int32(NC_AllowAgg) + v8 = int32(NC_AllowAgg) } else { - v7 = 0 + v8 = 0 } - *(*int32)(unsafe.Pointer(pNC + 40)) &= ^(libc.Int32FromInt32(NC_AllowWin) | v7) + *(*int32)(unsafe.Pointer(pNC + 40)) &= ^(libc.Int32FromInt32(NC_AllowWin) | v8) } } else { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) || (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -80143,15 +80430,15 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { _sqlite3WalkExprList(tls, pWalker, *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32))) } - if pWin != 0 { + if pWin != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { pSel = (*TNameContext)(unsafe.Pointer(pNC)).FpWinSelect if libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) == 0 { if pSel != 0 { - v8 = (*TSelect)(unsafe.Pointer(pSel)).FpWinDefn + v9 = (*TSelect)(unsafe.Pointer(pSel)).FpWinDefn } else { - v8 = uintptr(0) + v9 = uintptr(0) } - _sqlite3WindowUpdate(tls, pParse, v8, pWin, pDef) + _sqlite3WindowUpdate(tls, pParse, v9, pWin, pDef) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { break } @@ -80170,15 +80457,15 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } pNC2 = pNC for pNC2 != 0 && _sqlite3ReferencesSrcList(tls, pParse, pExpr, (*TNameContext)(unsafe.Pointer(pNC2)).FpSrcList) == 0 { - p9 = pExpr + 2 - *(*Tu8)(unsafe.Pointer(p9)) = Tu8(uint32(*(*Tu8)(unsafe.Pointer(p9))) + (libc.Uint32FromInt32(1) + (*TNameContext)(unsafe.Pointer(pNC2)).FnNestedSelect)) + p10 = pExpr + 2 + *(*Tu8)(unsafe.Pointer(p10)) = Tu8(uint32(*(*Tu8)(unsafe.Pointer(p10))) + (libc.Uint32FromInt32(1) + (*TNameContext)(unsafe.Pointer(pNC2)).FnNestedSelect)) pNC2 = (*TNameContext)(unsafe.Pointer(pNC2)).FpNext } if pNC2 != 0 && pDef != 0 { - p10 = pExpr + 2 - *(*Tu8)(unsafe.Pointer(p10)) = Tu8(uint32(*(*Tu8)(unsafe.Pointer(p10))) + (*TNameContext)(unsafe.Pointer(pNC2)).FnNestedSelect) - p11 = pNC2 + 40 - *(*int32)(unsafe.Pointer(p11)) = int32(uint32(*(*int32)(unsafe.Pointer(p11))) | (libc.Uint32FromInt32(NC_HasAgg) | ((*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags^libc.Uint32FromInt32(SQLITE_FUNC_ANYORDER))&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_MINMAX)|libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)))) + p11 = pExpr + 2 + *(*Tu8)(unsafe.Pointer(p11)) = Tu8(uint32(*(*Tu8)(unsafe.Pointer(p11))) + (*TNameContext)(unsafe.Pointer(pNC2)).FnNestedSelect) + p12 = pNC2 + 40 + *(*int32)(unsafe.Pointer(p12)) = int32(uint32(*(*int32)(unsafe.Pointer(p12))) | (libc.Uint32FromInt32(NC_HasAgg) | ((*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags^libc.Uint32FromInt32(SQLITE_FUNC_ANYORDER))&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_MINMAX)|libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)))) } } *(*int32)(unsafe.Pointer(pNC + 40)) |= savedAllowFlags @@ -80195,7 +80482,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7380, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7442, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -80207,7 +80494,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7391, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7453, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -80253,17 +80540,17 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6741, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break } if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { - v12 = int32(WRC_Abort) + v13 = int32(WRC_Abort) } else { - v12 = WRC_Continue + v13 = WRC_Continue } - return v12 + return v13 } // C documentation @@ -80378,7 +80665,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7402, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7464, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -80413,7 +80700,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7458, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7520, 0) return int32(1) } i = 0 @@ -80449,9 +80736,9 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r if pE == uintptr(0) { goto _2 } - if _sqlite3ExprIsInteger(tls, pE, bp) != 0 { + if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7492, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7554, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -80521,7 +80808,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7498, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7560, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -80555,7 +80842,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7559, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7621, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -80679,7 +80966,7 @@ func _resolveOrderGroupBy(tls *libc.TLS, pNC uintptr, pSelect uintptr, pOrderBy goto _1 } } - if _sqlite3ExprIsInteger(tls, pE2, bp) != 0 { + if _sqlite3ExprIsInteger(tls, pE2, bp, uintptr(0)) != 0 { /* The ORDER BY term is an integer constant. Again, set the column ** number so that sqlite3ResolveOrderGroupBy() will convert the ** order-by term to a copy of the result-set expression */ @@ -80786,7 +81073,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** moves the pOrderBy down to the sub-query. It will be moved back ** after the names have been resolved. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Converted) != 0 { - pSub = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect + pSub = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + 72)))).FpSelect (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy = (*TSelect)(unsafe.Pointer(p)).FpOrderBy (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } @@ -80800,9 +81087,9 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if !(i < (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc) { break } - pItem = (*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*104 + pItem = (*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80 /* Test of tag-20240424-1*/ - if (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags&uint32(SF_Resolved) == uint32(0) { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 && (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect)).FselFlags&uint32(SF_Resolved) == uint32(0) { if pOuterNC != 0 { v3 = (*TNameContext)(unsafe.Pointer(pOuterNC)).FnRef } else { @@ -80813,7 +81100,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { (*TParse)(unsafe.Pointer(pParse)).FzAuthContext = (*TSrcItem)(unsafe.Pointer(pItem)).FzName } - _sqlite3ResolveSelectNames(tls, pParse, (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect, pOuterNC) + _sqlite3ResolveSelectNames(tls, pParse, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect, pOuterNC) (*TParse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedContext if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) @@ -80825,7 +81112,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the refcount on all contexts between the current one and the ** context containing the column when it resolves a name. */ if pOuterNC != 0 { - libc.SetBitFieldPtr16Uint32(pItem+60+4, libc.BoolUint32((*TNameContext)(unsafe.Pointer(pOuterNC)).FnRef > nRef), 3, 0x8) + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.BoolUint32((*TNameContext)(unsafe.Pointer(pOuterNC)).FnRef > nRef), 4, 0x10) } } goto _2 @@ -80868,7 +81155,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7590, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7652, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -80886,8 +81173,8 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if !(i < (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc) { break } - pItem1 = (*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*104 - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x4>>2)) != 0 && _sqlite3ResolveExprListNames(tls, bp, *(*uintptr)(unsafe.Pointer(pItem1 + 88))) != 0 { + pItem1 = (*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80 + if int32(*(*uint32)(unsafe.Pointer(pItem1 + 24 + 4))&0x8>>3) != 0 && _sqlite3ResolveExprListNames(tls, bp, *(*uintptr)(unsafe.Pointer(pItem1 + 48))) != 0 { return int32(WRC_Abort) } goto _4 @@ -80921,7 +81208,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** These integers will be replaced by copies of the corresponding result ** set expressions by the call to resolveOrderGroupBy() below. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Converted) != 0 { - pSub1 = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect + pSub1 = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + 72)))).FpSelect (*TSelect)(unsafe.Pointer(p)).FpOrderBy = (*TSelect)(unsafe.Pointer(pSub1)).FpOrderBy (*TSelect)(unsafe.Pointer(pSub1)).FpOrderBy = uintptr(0) } @@ -80935,7 +81222,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** 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 (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7492) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7554) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -80946,7 +81233,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7629) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7691) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -80956,7 +81243,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7635, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7697, 0) return int32(WRC_Abort) } goto _6 @@ -81176,18 +81463,18 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter // ** Any errors cause an error message to be set in pParse. // */ func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { - bp := tls.Alloc(176) - defer tls.Free(176) + bp := tls.Alloc(144) + defer tls.Free(144) var rc, v1 int32 - var _ /* sNC at bp+112 */ TNameContext + var _ /* sNC at bp+88 */ TNameContext var _ /* sSrc at bp+0 */ TSrcList _, _ = rc, v1 - libc.Xmemset(tls, bp+112, 0, uint64(56)) - libc.Xmemset(tls, bp, 0, uint64(112)) + libc.Xmemset(tls, bp+88, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(88)) if pTab != 0 { (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpTab = pTab + (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP @@ -81195,16 +81482,16 @@ func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, t type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 112))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+112, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp + (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+112, pList) + rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) } return rc } @@ -81240,9 +81527,8 @@ func _sqlite3TableColumnAffinity(tls *libc.TLS, pTab uintptr, iCol int32) (r uin // ** SELECT * FROM t1 WHERE (select a from t1); // */ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r uint8) { - var op, v1 int32 - var v2 bool - _, _, _ = op, v1, v2 + var op int32 + _ = op op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) for int32(1) != 0 { if op == int32(TK_COLUMN) || op == int32(TK_AGG_COLUMN) && *(*uintptr)(unsafe.Pointer(pExpr + 64)) != uintptr(0) { @@ -81265,11 +81551,11 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r uint8) { op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) continue } - if v2 = op != int32(TK_REGISTER); !v2 { - v1 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop2) - op = v1 + if op != int32(TK_REGISTER) { + break } - if v2 || v1 == int32(TK_REGISTER) { + op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop2) + if op == int32(TK_REGISTER) { break } } @@ -81704,7 +81990,7 @@ func _codeCompare(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr, } p5 = libc.Int32FromUint8(_binaryCompareP5(tls, pLeft, pRight, jumpIfNull)) addr = _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, opcode, in2, dest, in1, p4, -int32(2)) - _sqlite3VdbeChangeP5(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, uint16(libc.Uint8FromInt32(p5))) + _sqlite3VdbeChangeP5(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, libc.Uint16FromInt32(p5)) return addr } @@ -81940,7 +82226,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6741, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82019,7 +82305,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7694, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7756, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -82364,11 +82650,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7742 + v2 = __ccgo_ts + 7804 } else { - v2 = __ccgo_ts + 1662 + v2 = __ccgo_ts + 1663 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7744, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7806, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -82417,7 +82703,7 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1782) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -82445,7 +82731,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7788, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7850, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -82465,7 +82751,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7822, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7884, libc.VaList(bp+8, p)) } // C documentation @@ -82536,7 +82822,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7872, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7934, libc.VaList(bp+8, pExpr)) } } } @@ -82588,7 +82874,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7892, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7954, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -82621,7 +82907,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7935, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7997, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83166,19 +83452,19 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { var i, nByte int32 - var pNew, pNewItem, pOldItem, pTab, v4 uintptr + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr var v1 uint64 var v2 Tu32 - _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pOldItem, pTab, v1, v2, v4 + _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 if p == uintptr(0) { return uintptr(0) } if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(104) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) + v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) } else { v1 = uint64(0) } - nByte = libc.Int32FromUint64(uint64(112) + v1) + nByte = libc.Int32FromUint64(uint64(88) + v1) pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) if pNew == uintptr(0) { return uintptr(0) @@ -83191,41 +83477,56 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { break } - pNewItem = pNew + 8 + uintptr(i)*104 - pOldItem = p + 8 + uintptr(i)*104 - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSchema = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSchema - (*TSrcItem)(unsafe.Pointer(pNewItem)).FzDatabase = _sqlite3DbStrDup(tls, db, (*TSrcItem)(unsafe.Pointer(pOldItem)).FzDatabase) + pNewItem = pNew + 8 + uintptr(i)*80 + pOldItem = p + 8 + uintptr(i)*80 + (*TSrcItem)(unsafe.Pointer(pNewItem)).Ffg = (*TSrcItem)(unsafe.Pointer(pOldItem)).Ffg + if int32(*(*uint32)(unsafe.Pointer(pOldItem + 24 + 4))&0x4>>2) != 0 { + pNewSubq = _sqlite3DbMallocRaw(tls, db, uint64(24)) + if pNewSubq == uintptr(0) { + libc.SetBitFieldPtr32Uint32(pNewItem+24+4, libc.Uint32FromInt32(0), 2, 0x4) + } else { + libc.Xmemcpy(tls, pNewSubq, *(*uintptr)(unsafe.Pointer(pOldItem + 72)), uint64(24)) + (*TSubquery)(unsafe.Pointer(pNewSubq)).FpSelect = _sqlite3SelectDup(tls, db, (*TSubquery)(unsafe.Pointer(pNewSubq)).FpSelect, flags) + if (*TSubquery)(unsafe.Pointer(pNewSubq)).FpSelect == uintptr(0) { + _sqlite3DbFree(tls, db, pNewSubq) + pNewSubq = uintptr(0) + libc.SetBitFieldPtr32Uint32(pNewItem+24+4, libc.Uint32FromInt32(0), 2, 0x4) + } + } + *(*uintptr)(unsafe.Pointer(pNewItem + 72)) = pNewSubq + } else { + if int32(*(*uint32)(unsafe.Pointer(pOldItem + 24 + 4))&0x10000>>16) != 0 { + *(*uintptr)(unsafe.Pointer(pNewItem + 72)) = *(*uintptr)(unsafe.Pointer(pOldItem + 72)) + } else { + *(*uintptr)(unsafe.Pointer(pNewItem + 72)) = _sqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 72))) + } + } (*TSrcItem)(unsafe.Pointer(pNewItem)).FzName = _sqlite3DbStrDup(tls, db, (*TSrcItem)(unsafe.Pointer(pOldItem)).FzName) (*TSrcItem)(unsafe.Pointer(pNewItem)).FzAlias = _sqlite3DbStrDup(tls, db, (*TSrcItem)(unsafe.Pointer(pOldItem)).FzAlias) - (*TSrcItem)(unsafe.Pointer(pNewItem)).Ffg = (*TSrcItem)(unsafe.Pointer(pOldItem)).Ffg (*TSrcItem)(unsafe.Pointer(pNewItem)).FiCursor = (*TSrcItem)(unsafe.Pointer(pOldItem)).FiCursor - (*TSrcItem)(unsafe.Pointer(pNewItem)).FaddrFillSub = (*TSrcItem)(unsafe.Pointer(pOldItem)).FaddrFillSub - (*TSrcItem)(unsafe.Pointer(pNewItem)).FregReturn = (*TSrcItem)(unsafe.Pointer(pOldItem)).FregReturn - (*TSrcItem)(unsafe.Pointer(pNewItem)).FregResult = (*TSrcItem)(unsafe.Pointer(pOldItem)).FregResult - if int32(uint32(*(*uint16)(unsafe.Pointer(pNewItem + 60 + 4))&0x2>>1)) != 0 { - *(*uintptr)(unsafe.Pointer(pNewItem + 88)) = _sqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 88))) + if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x2>>1) != 0 { + *(*uintptr)(unsafe.Pointer(pNewItem + 48)) = _sqlite3DbStrDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 48))) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pNewItem + 60 + 4))&0x4>>2)) != 0 { - *(*uintptr)(unsafe.Pointer(pNewItem + 88)) = _sqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 88)), flags) + if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x8>>3) != 0 { + *(*uintptr)(unsafe.Pointer(pNewItem + 48)) = _sqlite3ExprListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 48)), flags) } else { *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pNewItem)).Fu1)) = *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pOldItem)).Fu1)) } } (*TSrcItem)(unsafe.Pointer(pNewItem)).Fu2 = (*TSrcItem)(unsafe.Pointer(pOldItem)).Fu2 - if int32(uint32(*(*uint16)(unsafe.Pointer(pNewItem + 60 + 4))&0x100>>8)) != 0 { - (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 96)))).FnUse++ + if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { + (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpTab = v4 + v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 pTab = v4 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSelect = _sqlite3SelectDup(tls, db, (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSelect, flags) - if int32(uint32(*(*uint16)(unsafe.Pointer(pOldItem + 60 + 4))&0x400>>10)) != 0 { - *(*uintptr)(unsafe.Pointer(pNewItem + 72)) = _sqlite3IdListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 72))) + if int32(*(*uint32)(unsafe.Pointer(pOldItem + 24 + 4))&0x800>>11) != 0 { + *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3IdListDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64))) } else { - *(*uintptr)(unsafe.Pointer(pNewItem + 72)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 72)), flags) + *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed goto _3 @@ -83243,21 +83544,19 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(24)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(16)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) if pNew == uintptr(0) { return uintptr(0) } (*TIdList)(unsafe.Pointer(pNew)).FnId = (*TIdList)(unsafe.Pointer(p)).FnId - (*TIdList)(unsafe.Pointer(pNew)).FeU4 = (*TIdList)(unsafe.Pointer(p)).FeU4 i = 0 for { if !(i < (*TIdList)(unsafe.Pointer(p)).FnId) { break } - pNewItem = pNew + 8 + uintptr(i)*16 - pOldItem = p + 8 + uintptr(i)*16 + pNewItem = pNew + 8 + uintptr(i)*8 + pOldItem = p + 8 + uintptr(i)*8 (*TIdList_item)(unsafe.Pointer(pNewItem)).FzName = _sqlite3DbStrDup(tls, db, (*TIdList_item)(unsafe.Pointer(pOldItem)).FzName) - (*TIdList_item)(unsafe.Pointer(pNewItem)).Fu4 = (*TIdList_item)(unsafe.Pointer(pOldItem)).Fu4 goto _1 _1: ; @@ -83476,7 +83775,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7958, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8020, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -83490,8 +83789,8 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, } pList = _sqlite3ExprListAppend(tls, pParse, pList, pSubExpr) if pList != 0 { - (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr((*TExprList)(unsafe.Pointer(pList)).FnExpr-int32(1))*32))).FzEName = (*(*TIdList_item)(unsafe.Pointer(pColumns + 8 + uintptr(i)*16))).FzName - (*(*TIdList_item)(unsafe.Pointer(pColumns + 8 + uintptr(i)*16))).FzName = uintptr(0) + (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr((*TExprList)(unsafe.Pointer(pList)).FnExpr-int32(1))*32))).FzEName = (*(*TIdList_item)(unsafe.Pointer(pColumns + 8 + uintptr(i)*8))).FzName + (*(*TIdList_item)(unsafe.Pointer(pColumns + 8 + uintptr(i)*8))).FzName = uintptr(0) } goto _4 _4: @@ -83605,7 +83904,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7988, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8050, libc.VaList(bp+8, zObject)) } } @@ -83703,10 +84002,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8011) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8073) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8016) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8078) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -84063,7 +84362,7 @@ func _sqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32, bAllowSub // ** (4a) pExpr must come from an ON clause.. // ** (4b) and specifically the ON clause associated with the LEFT JOIN. // ** -// ** (5) If pSrc is not the right operand of a LEFT JOIN or the left +// ** (5) If pSrc is the right operand of a LEFT JOIN or the left // ** operand of a RIGHT JOIN, then pExpr must be from the WHERE // ** clause, not an ON clause. // ** @@ -84084,7 +84383,7 @@ func _sqlite3ExprIsSingleTableConstraint(tls *libc.TLS, pExpr uintptr, pSrcList var jj int32 var pSrc uintptr _, _ = jj, pSrc - pSrc = pSrcList + 8 + uintptr(iSrc)*104 + pSrc = pSrcList + 8 + uintptr(iSrc)*80 if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { return 0 /* rule (3) */ } @@ -84106,8 +84405,8 @@ func _sqlite3ExprIsSingleTableConstraint(tls *libc.TLS, pExpr uintptr, pSrcList if !(jj < iSrc) { break } - if *(*int32)(unsafe.Pointer(pExpr + 52)) == (*(*TSrcItem)(unsafe.Pointer(pSrcList + 8 + uintptr(jj)*104))).FiCursor { - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrcList + 8 + uintptr(jj)*104))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if *(*int32)(unsafe.Pointer(pExpr + 52)) == (*(*TSrcItem)(unsafe.Pointer(pSrcList + 8 + uintptr(jj)*80))).FiCursor { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrcList + 8 + uintptr(jj)*80))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { return 0 /* restriction (6) */ } break @@ -84227,13 +84526,19 @@ func _sqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit Tu8) (r i // ** 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. +// ** +// ** If the pParse pointer is provided, then allow the expression p to be +// ** a parameter (TK_VARIABLE) that is bound to an integer. +// ** But if pParse is NULL, then p must be a pure integer literal. // */ -func _sqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) (r int32) { +func _sqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr, pParse uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) + var pVal uintptr var rc int32 + var vv Tsqlite3_int64 var _ /* v at bp+0 */ int32 - _ = rc + _, _, _ = pVal, rc, vv rc = 0 if p == uintptr(0) { return 0 @@ -84246,13 +84551,35 @@ func _sqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) (r int32) { } switch libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) { case int32(TK_UPLUS): - rc = _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer(p)).FpLeft, pValue) + rc = _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer(p)).FpLeft, pValue, uintptr(0)) case int32(TK_UMINUS): *(*int32)(unsafe.Pointer(bp)) = 0 - if _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer(p)).FpLeft, bp) != 0 { + if _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer(p)).FpLeft, bp, uintptr(0)) != 0 { *(*int32)(unsafe.Pointer(pValue)) = -*(*int32)(unsafe.Pointer(bp)) rc = int32(1) } + case int32(TK_VARIABLE): + if pParse == uintptr(0) { + break + } + if (*TParse)(unsafe.Pointer(pParse)).FpVdbe == uintptr(0) { + break + } + if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_EnableQPSG) != uint64(0) { + break + } + _sqlite3VdbeSetVarmask(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32((*TExpr)(unsafe.Pointer(p)).FiColumn)) + pVal = _sqlite3VdbeGetBoundValue(tls, (*TParse)(unsafe.Pointer(pParse)).FpReprepare, int32((*TExpr)(unsafe.Pointer(p)).FiColumn), uint8(SQLITE_AFF_BLOB)) + if pVal != 0 { + if Xsqlite3_value_type(tls, pVal) == int32(SQLITE_INTEGER) { + vv = Xsqlite3_value_int64(tls, pVal) + if vv == vv&int64(0x7fffffff) { /* non-negative numbers only */ + *(*int32)(unsafe.Pointer(pValue)) = int32(vv) + rc = int32(1) + } + } + _sqlite3ValueFree(tls, pVal) + } default: break } @@ -84356,13 +84683,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) (r i // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8022) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8084) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8030) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8092) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8036) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8098) == 0 { return int32(1) } return 0 @@ -84380,9 +84707,9 @@ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var iCol, ii int32 _, _, _ = azOpt, iCol, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8022, - 1: __ccgo_ts + 8030, - 2: __ccgo_ts + 8036, + 0: __ccgo_ts + 8084, + 1: __ccgo_ts + 8092, + 2: __ccgo_ts + 8098, } ii = 0 for { @@ -84450,10 +84777,10 @@ func _isCandidateForInOpt(tls *libc.TLS, pX uintptr) (r uintptr) { if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != int32(1) { return uintptr(0) } /* Single term in FROM clause */ - if (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSelect != 0 { + if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + 24 + 4))&0x4>>2) != 0 { return uintptr(0) } /* FROM is not a subquery or view */ - pTab = (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpTab + pTab = (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab /* FROM clause is not a view */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { return uintptr(0) @@ -84611,7 +84938,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 52 + v2 = pParse + 56 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -84653,7 +84980,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 /* Because of isCandidateForInOpt(p) */ /* Because of isCandidateForInOpt(p) */ /* Because of isCandidateForInOpt(p) */ - pTab = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpTab + pTab = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab /* Code an OP_Transaction and OP_TableLock for <table>. */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3CodeVerifySchema(tls, pParse, iDb) @@ -84664,7 +84991,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8040, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8102, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -84764,12 +85091,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<<nExpr-uint64(1) { /* If we reach this point, that means the index pIdx is usable */ iAddr1 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8087, libc.VaList(bp+8, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8149, libc.VaList(bp+8, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenRead), iTab, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIdx)).Ftnum), iDb) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) eType = int32(IN_INDEX_INDEX_ASC) + libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder))) if prRhsHasNull != 0 { - v11 = pParse + 56 + v11 = pParse + 60 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(prRhsHasNull)) = v10 @@ -84810,7 +85137,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = 0 } else { if prRhsHasNull != 0 { - v14 = pParse + 56 + v14 = pParse + 60 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) v12 = v13 @@ -84903,7 +85230,7 @@ func _sqlite3SubselectError(tls *libc.TLS, pParse uintptr, nActual int32, nExpec var zFmt uintptr _ = zFmt if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - zFmt = __ccgo_ts + 8118 + zFmt = __ccgo_ts + 8180 _sqlite3ErrorMsg(tls, pParse, zFmt, libc.VaList(bp+8, nActual, nExpect)) } } @@ -84925,8 +85252,63 @@ func _sqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { _sqlite3SubselectError(tls, pParse, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FpEList)).FnExpr, int32(1)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6741, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + } +} + +// C documentation +// +// /* +// ** Scan all previously generated bytecode looking for an OP_BeginSubrtn +// ** that is compatible with pExpr. If found, add the y.sub values +// ** to pExpr and return true. If not found, return false. +// */ +func _findCompatibleInRhsSubrtn(tls *libc.TLS, pParse uintptr, pExpr uintptr, pNewSig uintptr) (r int32) { + var pEnd, pOp, pSig, v uintptr + _, _, _, _ = pEnd, pOp, pSig, v + if pNewSig == uintptr(0) { + return 0 + } + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FmSubrtnSig)&(int32(1)<<((*TSubrtnSig)(unsafe.Pointer(pNewSig)).FselId&int32(7))) == 0 { + return 0 + } + v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe + pOp = _sqlite3VdbeGetOp(tls, v, int32(1)) + pEnd = _sqlite3VdbeGetLastOp(tls, v) + for { + if !(pOp < pEnd) { + break + } + if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type) != -int32(17) { + goto _1 + } + pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) + if !((*TSubrtnSig)(unsafe.Pointer(pSig)).FbComplete != 0) { + goto _1 + } + if (*TSubrtnSig)(unsafe.Pointer(pNewSig)).FselId != (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId { + goto _1 + } + if libc.Xstrcmp(tls, (*TSubrtnSig)(unsafe.Pointer(pNewSig)).FzAff, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff) != 0 { + goto _1 + } + (*(*struct { + FiAddr int32 + FregReturn int32 + })(unsafe.Pointer(pExpr + 64))).FiAddr = (*TSubrtnSig)(unsafe.Pointer(pSig)).FiAddr + (*(*struct { + FiAddr int32 + FregReturn int32 + })(unsafe.Pointer(pExpr + 64))).FregReturn = (*TSubrtnSig)(unsafe.Pointer(pSig)).FregReturn + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TSubrtnSig)(unsafe.Pointer(pSig)).FiTable + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) + return int32(1) + goto _1 + _1: + ; + pOp += 24 } + return 0 } // C documentation @@ -84956,13 +85338,14 @@ func _sqlite3VectorErrorMsg(tls *libc.TLS, pParse uintptr, pExpr uintptr) { func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32) { bp := tls.Alloc(80) defer tls.Free(80) - var addr, addrOnce, i, i1, nVal, r1, r2, rc, v1, v4 int32 - var p, pCopy, pE2, pEList, pItem, pKeyInfo, pLeft, pList, pSelect, v, v2, v3 uintptr + var addr, addrBloom, addrOnce, i, i1, nVal, r1, r2, rc, regBloom, v1, v4, v6 int32 + var p, pCopy, pE2, pEList, pItem, pKeyInfo, pLeft, pList, pSelect, pSig, v, v2, v3, v5 uintptr var _ /* affinity at bp+40 */ uint8 var _ /* dest at bp+0 */ TSelectDest - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr, addrOnce, i, i1, nVal, p, pCopy, pE2, pEList, pItem, pKeyInfo, pLeft, pList, pSelect, r1, r2, rc, v, v1, v2, v3, v4 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr, addrBloom, addrOnce, i, i1, nVal, p, pCopy, pE2, pEList, pItem, pKeyInfo, pLeft, pList, pSelect, pSig, r1, r2, rc, regBloom, v, v1, v2, v3, v4, v5, v6 addrOnce = 0 /* the LHS of the IN operator */ pKeyInfo = uintptr(0) /* The prepared statement under construction */ + pSig = uintptr(0) /* Signature for this subroutine */ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* The evaluation of the IN must be repeated every time it ** is encountered if any of the following is true: @@ -84975,14 +85358,26 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 ** and reuse it many names. */ if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_VarSelect)) != libc.Uint32FromInt32(0)) && (*TParse)(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. + /* Reuse of the RHS is allowed + ** + ** Compute a signature for the RHS of the IN operator to facility + ** finding and reusing prior instances of the same IN operator. */ - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) && (*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FselFlags&uint32(SF_All) == uint32(0) { + pSig = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(32)) + if pSig != 0 { + (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId = libc.Int32FromUint32((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FselId) + (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff = _exprINAffinity(tls, pParse, pExpr) + } + } + /* Check to see if there is a prior materialization of the RHS of + ** this IN operator. If there is, then make use of that prior + ** materialization rather than recomputing it. + */ + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != uint32(0) || _findCompatibleInRhsSubrtn(tls, pParse, pExpr, pSig) != 0 { addrOnce = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8162, libc.VaList(bp+56, (*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FselId)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8224, libc.VaList(bp+56, (*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FselId)) } _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*(*struct { FiAddr int32 @@ -84993,11 +85388,15 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 })(unsafe.Pointer(pExpr + 64))).FiAddr) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), iTab, (*TExpr)(unsafe.Pointer(pExpr)).FiTable) _sqlite3VdbeJumpHere(tls, v, addrOnce) + if pSig != 0 { + _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff) + _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSig) + } return } /* Begin coding the subroutine */ *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*(*struct { @@ -85011,6 +85410,20 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FregReturn) + int32(1) + if pSig != 0 { + (*TSubrtnSig)(unsafe.Pointer(pSig)).FbComplete = uint8(0) + (*TSubrtnSig)(unsafe.Pointer(pSig)).FiAddr = (*(*struct { + FiAddr int32 + FregReturn int32 + })(unsafe.Pointer(pExpr + 64))).FiAddr + (*TSubrtnSig)(unsafe.Pointer(pSig)).FregReturn = (*(*struct { + FiAddr int32 + FregReturn int32 + })(unsafe.Pointer(pExpr + 64))).FregReturn + (*TSubrtnSig)(unsafe.Pointer(pSig)).FiTable = iTab + (*TParse)(unsafe.Pointer(pParse)).FmSubrtnSig = libc.Uint8FromInt32(int32(1) << ((*TSubrtnSig)(unsafe.Pointer(pSig)).FselId & int32(7))) + _sqlite3VdbeChangeP4(tls, v, -int32(1), pSig, -int32(17)) + } addrOnce = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) } /* Check to see if this is a vector IN operator */ @@ -85031,27 +85444,44 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 pSelect = *(*uintptr)(unsafe.Pointer(pExpr + 32)) pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList if addrOnce != 0 { - v3 = __ccgo_ts + 1662 + v3 = __ccgo_ts + 1663 } else { - v3 = __ccgo_ts + 8185 + v3 = __ccgo_ts + 8247 } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+8197, libc.VaList(bp+56, v3, (*TSelect)(unsafe.Pointer(pSelect)).FselId)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+8259, libc.VaList(bp+56, v3, (*TSelect)(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. */ if (*TExprList)(unsafe.Pointer(pEList)).FnExpr == nVal { + addrBloom = 0 _sqlite3SelectDestInit(tls, bp, int32(SRT_Set), iTab) (*(*TSelectDest)(unsafe.Pointer(bp))).FzAffSdst = _exprINAffinity(tls, pParse, pExpr) (*TSelect)(unsafe.Pointer(pSelect)).FiLimit = 0 + if addrOnce != 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { + v5 = pParse + 60 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) + regBloom = v4 + addrBloom = _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(10000), regBloom) + (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 = regBloom + } /* Caused by OOM in sqlite3KeyInfoAlloc() */ pCopy = _sqlite3SelectDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSelect, 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { - v4 = int32(1) + v6 = int32(1) } else { - v4 = _sqlite3Select(tls, pParse, pCopy, bp) + v6 = _sqlite3Select(tls, pParse, pCopy, bp) } - rc = v4 + rc = v6 _sqlite3SelectDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pCopy) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*(*TSelectDest)(unsafe.Pointer(bp))).FzAffSdst) + if addrBloom != 0 { + (*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetOp(tls, v, addrOnce))).Fp3 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 + if (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 == 0 { + _sqlite3VdbeChangeToNoop(tls, v, addrBloom) + } else { + (*TVdbeOp)(unsafe.Pointer(_sqlite3VdbeGetOp(tls, v, addrOnce))).Fp3 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 + } + } if rc != 0 { _sqlite3KeyInfoUnref(tls, pKeyInfo) return @@ -85064,8 +85494,8 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 } p = _sqlite3VectorFieldSubexpr(tls, pLeft, i) *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) = _sqlite3BinaryCompareCollSeq(tls, pParse, p, (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FpExpr) - goto _5 - _5: + goto _7 + _7: ; i++ } @@ -85109,8 +85539,8 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 _sqlite3ExprCode(tls, pParse, pE2, r1) _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), r1, int32(1), r2, bp+40, int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iTab, r2, r1, int32(1)) - goto _6 - _6: + goto _8 + _8: ; i1-- pItem += 32 @@ -85119,6 +85549,9 @@ func _sqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int3 _sqlite3ReleaseTempReg(tls, pParse, r2) } } + if pSig != 0 { + (*TSubrtnSig)(unsafe.Pointer(pSig)).FbComplete = uint8(1) + } if pKeyInfo != 0 { _sqlite3VdbeChangeP4(tls, v, addr, pKeyInfo, -int32(8)) } @@ -85170,7 +85603,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 /* If this routine has already been coded, then invoke it as a ** subroutine. */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8216, libc.VaList(bp+48, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8278, libc.VaList(bp+48, (*TSelect)(unsafe.Pointer(pSel)).FselId)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*(*struct { FiAddr int32 FregReturn int32 @@ -85182,7 +85615,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 } /* Begin coding the subroutine */ *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*(*struct { @@ -85220,11 +85653,11 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 ** preexisting limit is discarded in place of the new LIMIT 1. */ if addrOnce != 0 { - v3 = __ccgo_ts + 1662 + v3 = __ccgo_ts + 1663 } else { - v3 = __ccgo_ts + 8185 + v3 = __ccgo_ts + 8247 } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+8234, libc.VaList(bp+48, v3, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+8296, libc.VaList(bp+48, v3, (*TSelect)(unsafe.Pointer(pSel)).FselId)) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_SELECT) { v4 = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpEList)).FnExpr } else { @@ -85232,7 +85665,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 } nReg = v4 _sqlite3SelectDestInit(tls, bp, 0, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1)) - *(*int32)(unsafe.Pointer(pParse + 56)) += nReg + *(*int32)(unsafe.Pointer(pParse + 60)) += nReg if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_SELECT) { (*(*TSelectDest)(unsafe.Pointer(bp))).FeDest = uint8(SRT_Mem) (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm @@ -85246,7 +85679,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 /* 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 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1782) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = uint8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -85255,7 +85688,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8255) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8317) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -85339,13 +85772,13 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals bp := tls.Alloc(16) defer tls.Free(16) var addrTop, addrTruthOp, destNotNull, destStep2, destStep6, eType, i, ii, labelOk, nVector, op, op1, r2, r3, rLhs, rLhsOrig, regCkNull, v5, v6, v7 int32 - var aiMap, p, p1, pColl, pColl1, pLeft, pList, v, zAff, v1 uintptr + var aiMap, p, p1, pColl, pColl1, pLeft, pList, pOp, v, zAff, v1 uintptr var okConstFactor Tu8 var _ /* iDummy at bp+4 */ int32 var _ /* iTab at bp+8 */ int32 var _ /* rRhsHasNull at bp+0 */ int32 var _ /* regToFree at bp+12 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrTop, addrTruthOp, aiMap, destNotNull, destStep2, destStep6, eType, i, ii, labelOk, nVector, okConstFactor, op, op1, p, p1, pColl, pColl1, pLeft, pList, r2, r3, rLhs, rLhsOrig, regCkNull, v, zAff, v1, v5, v6, v7 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrTop, addrTruthOp, aiMap, destNotNull, destStep2, destStep6, eType, i, ii, labelOk, nVector, okConstFactor, op, op1, p, p1, pColl, pColl1, pLeft, pList, pOp, r2, r3, rLhs, rLhsOrig, regCkNull, v, zAff, v1, v5, v6, v7 *(*int32)(unsafe.Pointer(bp)) = 0 /* Statement under construction */ aiMap = uintptr(0) /* Map from vector field to index column */ zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ @@ -85358,7 +85791,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1))+uint64(1)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -85516,6 +85949,15 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), rLhs, nVector, 0, zAff, nVector) if destIfFalse == destIfNull { /* Combine Step 3 and Step 5 into a single opcode */ + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != uint32(0) { + pOp = _sqlite3VdbeGetOp(tls, v, (*(*struct { + FiAddr int32 + FregReturn int32 + })(unsafe.Pointer(pExpr + 64))).FiAddr) + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) + } + } _sqlite3VdbeAddOp4Int(tls, v, int32(OP_NotFound), *(*int32)(unsafe.Pointer(bp + 8)), destIfFalse, rLhs, nVector) goto sqlite3ExprCodeIN_finished } @@ -85642,13 +86084,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<<libc.Int32FromInt32(32)) { - if Xsqlite3_strnicmp(tls, z, __ccgo_ts+8257, int32(2)) == 0 { + if Xsqlite3_strnicmp(tls, z, __ccgo_ts+8319, int32(2)) == 0 { if negFlag != 0 { - v1 = __ccgo_ts + 5138 + v1 = __ccgo_ts + 5139 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8260, libc.VaList(bp+16, v1, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8322, libc.VaList(bp+16, v1, pExpr)) } else { _codeReal(tls, v, z, negFlag, iMem) } @@ -85736,7 +86178,7 @@ func _sqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iT if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(v1)).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { pParse = _sqlite3VdbeParser(tls, v) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_BUSY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8287, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8349, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { savedSelfTab = (*TParse)(unsafe.Pointer(pParse)).FiSelfTab p2 = pCol + 14 @@ -85805,17 +86247,20 @@ func _sqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, // ** 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) { +func _sqlite3ExprToRegister(tls *libc.TLS, pExpr uintptr, iReg int32) { var p uintptr _ = p p = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) if p == uintptr(0) { return } - (*TExpr)(unsafe.Pointer(p)).Fop2 = (*TExpr)(unsafe.Pointer(p)).Fop - (*TExpr)(unsafe.Pointer(p)).Fop = uint8(TK_REGISTER) - (*TExpr)(unsafe.Pointer(p)).FiTable = iReg - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Skip)) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_REGISTER) { + } else { + (*TExpr)(unsafe.Pointer(p)).Fop2 = (*TExpr)(unsafe.Pointer(p)).Fop + (*TExpr)(unsafe.Pointer(p)).Fop = uint8(TK_REGISTER) + (*TExpr)(unsafe.Pointer(p)).FiTable = iReg + *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Skip)) + } } // C documentation @@ -85842,7 +86287,7 @@ func _exprCodeVector(tls *libc.TLS, pParse uintptr, p uintptr, piFreeable uintpt iResult = _sqlite3CodeSubselect(tls, pParse, p) } else { iResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nResult + *(*int32)(unsafe.Pointer(pParse + 60)) += nResult i = 0 for { if !(i < nResult) { @@ -85953,16 +86398,16 @@ func _exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFunc ** the SQLite type logic. */ azAff = [6]uintptr{ - 0: __ccgo_ts + 8317, - 1: __ccgo_ts + 8322, - 2: __ccgo_ts + 8327, - 3: __ccgo_ts + 6370, - 4: __ccgo_ts + 6365, - 5: __ccgo_ts + 8335, + 0: __ccgo_ts + 8379, + 1: __ccgo_ts + 8384, + 2: __ccgo_ts + 8389, + 3: __ccgo_ts + 6387, + 4: __ccgo_ts + 6382, + 5: __ccgo_ts + 8397, } aff = _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(pFarg + 8))).FpExpr) if libc.Int32FromUint8(aff) <= int32(SQLITE_AFF_NONE) { - v2 = __ccgo_ts + 8343 + v2 = __ccgo_ts + 8405 } else { v2 = azAff[libc.Int32FromUint8(aff)-int32(SQLITE_AFF_BLOB)] } @@ -85975,6 +86420,68 @@ func _exprCodeInlineFunction(tls *libc.TLS, pParse uintptr, pFarg uintptr, iFunc // C documentation // // /* +// ** Expression Node callback for sqlite3ExprCanReturnSubtype(). +// ** +// ** Only a function call is able to return a subtype. So if the node +// ** is not a function call, return WRC_Prune immediately. +// ** +// ** A function call is able to return a subtype if it has the +// ** SQLITE_RESULT_SUBTYPE property. +// ** +// ** Assume that every function is able to pass-through a subtype from +// ** one of its argument (using sqlite3_result_value()). Most functions +// ** are not this way, but we don't have a mechanism to distinguish those +// ** that are from those that are not, so assume they all work this way. +// ** That means that if one of its arguments is another function and that +// ** other function is able to return a subtype, then this function is +// ** able to return a subtype. +// */ +func _exprNodeCanReturnSubtype(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { + var db, pDef uintptr + var n, v1 int32 + _, _, _, _ = db, n, pDef, v1 + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_FUNCTION) { + return int32(WRC_Prune) + } + db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v1 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr + } else { + v1 = 0 + } + n = v1 + pDef = _sqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8)), n, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, uint8(0)) + if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_RESULT_SUBTYPE) != uint32(0) { + (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) + return int32(WRC_Prune) + } + return WRC_Continue +} + +// C documentation +// +// /* +// ** Return TRUE if expression pExpr is able to return a subtype. +// ** +// ** A TRUE return does not guarantee that a subtype will be returned. +// ** It only indicates that a subtype return is possible. False positives +// ** are acceptable as they only disable an optimization. False negatives, +// ** on the other hand, can lead to incorrect answers. +// */ +func _sqlite3ExprCanReturnSubtype(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { + bp := tls.Alloc(48) + defer tls.Free(48) + var _ /* w at bp+0 */ TWalker + libc.Xmemset(tls, bp, 0, uint64(48)) + (*(*TWalker)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TWalker)(unsafe.Pointer(bp))).FxExprCallback = __ccgo_fp(_exprNodeCanReturnSubtype) + _sqlite3WalkExpr(tls, bp, pExpr) + return libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode) +} + +// C documentation +// +// /* // ** Check to see if pExpr is one of the indexed expressions on pParse->pIdxEpr. // ** If it is, then resolve the expression by reading from the index and // ** return the register into which the value has been read. If pExpr is @@ -86008,6 +86515,13 @@ func _sqlite3IndexedExprLookup(tls *libc.TLS, pParse uintptr, pExpr uintptr, tar /* Affinity mismatch on a generated column */ goto _1 } + /* Functions that might set a subtype should not be replaced by the + ** value taken from an expression index if they are themselves an + ** argument to another scalar function or aggregate. + ** https://sqlite.org/forum/forumpost/68d284c86b082c3e */ + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) && _sqlite3ExprCanReturnSubtype(tls, pParse, pExpr) != 0 { + goto _1 + } v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe if (*TIndexedExpr)(unsafe.Pointer(p)).FbMaybeNullRow != 0 { /* If the index is on a NULL row due to an outer join, then we @@ -86160,6 +86674,7 @@ expr_code_doover: } } } + /* Otherwise, fall thru into the TK_COLUMN case */ fallthrough case int32(TK_COLUMN): iTab = (*TExpr)(unsafe.Pointer(pExpr)).FiTable @@ -86182,7 +86697,7 @@ expr_code_doover: iSrc = int32(_sqlite3TableColumnToStorage(tls, pTab1, int16(iCol))) - (*TParse)(unsafe.Pointer(pParse)).FiSelfTab if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol1)).FcolFlags)&int32(COLFLAG_BUSY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8287, libc.VaList(bp+160, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8349, libc.VaList(bp+160, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) return 0 } p3 = pCol1 + 14 @@ -86355,7 +86870,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8348, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8410, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -86382,7 +86897,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8375, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8437, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -86411,7 +86926,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -86487,7 +87002,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7958, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8020, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -86550,7 +87065,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6741, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -86624,7 +87139,7 @@ expr_code_doover: _sqlite3ExprDelete(tls, db1, pDel) break } - _exprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp)) + _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp)) libc.Xmemset(tls, bp+80, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp + 80))).Fop = uint8(TK_EQ) (*(*TExpr)(unsafe.Pointer(bp + 80))).FpLeft = pDel @@ -86665,21 +87180,22 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8399, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8461, 0) return 0 } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { _sqlite3MayAbort(tls, pParse) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Ignore) { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), SQLITE_OK, int32(OE_Ignore), 0, *(*uintptr)(unsafe.Pointer(pExpr + 8)), 0) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Halt), SQLITE_OK, int32(OE_Ignore)) } else { + r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) if (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0 { v14 = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(7)<<libc.Int32FromInt32(8) } else { v14 = int32(SQLITE_ERROR) } - _sqlite3HaltConstraint(tls, pParse, v14, libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr), *(*uintptr)(unsafe.Pointer(pExpr + 8)), 0, uint8(0)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Halt), v14, libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr), r1) } break } @@ -86738,7 +87254,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 56 + v3 = pParse + 60 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 @@ -86754,7 +87270,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 56 + v5 = pParse + 60 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -86998,7 +87514,7 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).Fop = uint8(TK_LE) (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr - _exprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) + _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) if xJump != 0 { (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { @@ -87446,16 +87962,25 @@ func _sqlite3ExprIfFalseDup(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. +// ** +// ** If the SQLITE_EnableQPSG flag is set on the database connection, then +// ** this routine always returns false. // */ func _exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var iVar, res int32 + var iVar, res, v1 int32 var pL uintptr var _ /* pR at bp+0 */ uintptr - _, _, _ = iVar, pL, res - res = 0 + _, _, _, _ = iVar, pL, res, v1 + res = int32(2) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_VARIABLE) && int32((*TExpr)(unsafe.Pointer(pVar)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { + return 0 + } + if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_EnableQPSG) != uint64(0) { + return int32(2) + } _sqlite3ValueFromExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr, uint8(SQLITE_UTF8), uint8(SQLITE_AFF_BLOB), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { iVar = int32((*TExpr)(unsafe.Pointer(pVar)).FiColumn) @@ -87465,7 +87990,12 @@ func _exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uin if Xsqlite3_value_type(tls, pL) == int32(SQLITE_TEXT) { Xsqlite3_value_text(tls, pL) /* Make sure the encoding is UTF-8 */ } - res = libc.BoolInt32(0 == _sqlite3MemCompare(tls, pL, *(*uintptr)(unsafe.Pointer(bp)), uintptr(0))) + if _sqlite3MemCompare(tls, pL, *(*uintptr)(unsafe.Pointer(bp)), uintptr(0)) != 0 { + v1 = int32(2) + } else { + v1 = 0 + } + res = v1 } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ValueFree(tls, pL) @@ -87497,12 +88027,10 @@ func _exprCompareVariable(tls *libc.TLS, pParse uintptr, pVar uintptr, pExpr uin // ** just might result in some slightly slower code. But returning // ** an incorrect 0 or 1 could lead to a malfunction. // ** -// ** If pParse is not NULL then TK_VARIABLE terms in pA with bindings in -// ** pParse->pReprepare can be matched against literals in pB. The -// ** pParse->pVdbe->expmask bitmask is updated for each variable referenced. -// ** If pParse is NULL (the normal case) then any TK_VARIABLE term in -// ** Argument pParse should normally be NULL. If it is not NULL and pA or -// ** pB causes a return value of 2. +// ** If pParse is not NULL and SQLITE_EnableQPSG is off then TK_VARIABLE +// ** terms in pA with bindings in pParse->pReprepare can be matched against +// ** literals in pB. The pParse->pVdbe->expmask bitmask is updated for +// ** each variable referenced. // */ func _sqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) (r int32) { var combinedFlags Tu32 @@ -87516,8 +88044,8 @@ func _sqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, } return v1 } - if pParse != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_VARIABLE) && _exprCompareVariable(tls, pParse, pA, pB) != 0 { - return 0 + if pParse != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pA)).Fop) == int32(TK_VARIABLE) { + return _exprCompareVariable(tls, pParse, pA, pB) } combinedFlags = (*TExpr)(unsafe.Pointer(pA)).Fflags | (*TExpr)(unsafe.Pointer(pB)).Fflags if combinedFlags&uint32(EP_IntValue) != 0 { @@ -87755,17 +88283,94 @@ func _exprImpliesNotNull(tls *libc.TLS, pParse uintptr, p uintptr, pNN uintptr, // C documentation // // /* +// ** Return true if the boolean value of the expression is always either +// ** FALSE or NULL. +// */ +func _sqlite3ExprIsNotTrue(tls *libc.TLS, pExpr uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var _ /* v at bp+0 */ int32 + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NULL) { + return int32(1) + } + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_TRUEFALSE) && _sqlite3ExprTruthValue(tls, pExpr) == 0 { + return int32(1) + } + *(*int32)(unsafe.Pointer(bp)) = int32(1) + if _sqlite3ExprIsInteger(tls, pExpr, bp, uintptr(0)) != 0 && *(*int32)(unsafe.Pointer(bp)) == 0 { + return int32(1) + } + return 0 +} + +// C documentation +// +// /* +// ** Return true if the expression is one of the following: +// ** +// ** CASE WHEN x THEN y END +// ** CASE WHEN x THEN y ELSE NULL END +// ** CASE WHEN x THEN y ELSE false END +// ** iif(x,y) +// ** iif(x,y,NULL) +// ** iif(x,y,false) +// */ +func _sqlite3ExprIsIIF(tls *libc.TLS, db uintptr, pExpr uintptr) (r int32) { + var pDef, pList, z uintptr + _, _, _ = pDef, pList, z + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) { + z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) != int32('i') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) != int32('I') { + return 0 + } + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) == uintptr(0) { + return 0 + } + pDef = _sqlite3FindFunction(tls, db, z, (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, uint8(0)) + if pDef == uintptr(0) { + return 0 + } + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) == uint32(0) { + return 0 + } + if int32(int64((*TFuncDef)(unsafe.Pointer(pDef)).FpUserData)) != int32(INLINEFUNC_iif) { + return 0 + } + } else { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_CASE) { + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != uintptr(0) { + return 0 + } + } else { + return 0 + } + } + pList = *(*uintptr)(unsafe.Pointer(pExpr + 32)) + if (*TExprList)(unsafe.Pointer(pList)).FnExpr == int32(2) { + return int32(1) + } + if (*TExprList)(unsafe.Pointer(pList)).FnExpr == int32(3) && _sqlite3ExprIsNotTrue(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 2*32))).FpExpr) != 0 { + return int32(1) + } + return 0 +} + +// C documentation +// +// /* // ** Return true if we can prove the pE2 will always be true if pE1 is // ** true. Return false if we cannot complete the proof or if pE2 might // ** be false. Examples: // ** -// ** pE1: x==5 pE2: x==5 Result: true -// ** pE1: x>0 pE2: x==5 Result: false -// ** pE1: x=21 pE2: x=21 OR y=43 Result: true -// ** pE1: x!=123 pE2: x IS NOT NULL Result: true -// ** pE1: x!=?1 pE2: x IS NOT NULL Result: true -// ** pE1: x IS NULL pE2: x IS NOT NULL Result: false -// ** pE1: x IS ?2 pE2: x IS NOT NULL Result: false +// ** pE1: x==5 pE2: x==5 Result: true +// ** pE1: x>0 pE2: x==5 Result: false +// ** pE1: x=21 pE2: x=21 OR y=43 Result: true +// ** pE1: x!=123 pE2: x IS NOT NULL Result: true +// ** pE1: x!=?1 pE2: x IS NOT NULL Result: true +// ** pE1: x IS NULL pE2: x IS NOT NULL Result: false +// ** pE1: x IS ?2 pE2: x IS NOT NULL Result: false +// ** pE1: iif(x,y) pE2: x Result: true +// ** PE1: iif(x,y,0) pE2: x Result: true // ** // ** When comparing TK_COLUMN nodes between pE1 and pE2, if pE2 has // ** Expr.iTable<0 then assume a table number given by iTab. @@ -87789,6 +88394,9 @@ func _sqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uin if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE2)).Fop) == int32(TK_NOTNULL) && _exprImpliesNotNull(tls, pParse, pE1, (*TExpr)(unsafe.Pointer(pE2)).FpLeft, iTab, 0) != 0 { return int32(1) } + if _sqlite3ExprIsIIF(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pE1) != 0 { + return _sqlite3ExprImpliesExpr(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE1 + 32)) + 8))).FpExpr, pE2, iTab) + } return 0 } @@ -88068,7 +88676,7 @@ func _selectRefEnter(tls *libc.TLS, pWalker uintptr, pSelect uintptr) (r int32) if !(i < int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc)) { break } - *(*int32)(unsafe.Pointer((*TRefSrcList)(unsafe.Pointer(p)).FaiExclude + uintptr(j)*4)) = (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104))).FiCursor + *(*int32)(unsafe.Pointer((*TRefSrcList)(unsafe.Pointer(p)).FaiExclude + uintptr(j)*4)) = (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80))).FiCursor goto _1 _1: ; @@ -88116,7 +88724,7 @@ func _exprRefToSrcList(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80))).FiCursor { p3 = pWalker + 36 *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(1)) return WRC_Continue @@ -88468,7 +89076,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) _3: ; i++ - pItem += 104 + pItem += 80 } /* end loop over pSrcList */ } return WRC_Continue @@ -88511,7 +89119,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) nArg = v5 (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 52 + v7 = pParse + 56 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 @@ -88527,7 +89135,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 52 + v9 = pParse + 56 v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(v9))++ (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 @@ -88612,7 +89220,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -88657,11 +89265,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 44)) += nReg - *(*int32)(unsafe.Pointer(pParse + 40)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 48)) += nReg + *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nReg + *(*int32)(unsafe.Pointer(pParse + 60)) += nReg } return i } @@ -88779,8 +89387,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6589, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8449, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8511, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -88799,9 +89407,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, bp := tls.Alloc(48) defer tls.Free(48) (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8477, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8539, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8652, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8714, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -88817,9 +89425,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8826, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8888, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8973, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9035, 0) } } @@ -88875,7 +89483,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9124, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9186, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -88884,11 +89492,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9183, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9245, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9189, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9251, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -88918,21 +89526,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9216, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9278, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9400, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9462, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9705, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9721, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9767, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9783, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9779, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -88940,7 +89548,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -88948,7 +89556,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10044, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10106, 0) goto exit_rename_table exit_rename_table: ; @@ -88965,7 +89573,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10057, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10119, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -89005,11 +89613,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10095, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10157, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10127, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10189, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -89025,10 +89633,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10154) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10216) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10213) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10275) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -89040,13 +89648,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10266) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10328) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10312) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10374) } } /* Modify the CREATE TABLE statement. */ @@ -89060,7 +89668,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10339, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10401, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -89088,7 +89696,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10485, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10547, libc.VaList(bp+16, zTab, zDb)) } } } @@ -89126,12 +89734,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10838, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10900, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10872, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10934, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -89155,7 +89763,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10902, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10964, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -89216,18 +89824,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10921 + zType = __ccgo_ts + 10983 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10926 + zType = __ccgo_ts + 10988 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 10940 + v1 = __ccgo_ts + 11002 } else { - v1 = __ccgo_ts + 10957 + v1 = __ccgo_ts + 11019 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10975, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11037, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89288,11 +89896,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld iCol++ } if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10993, libc.VaList(bp+8, pOld)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11055, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1662, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1663, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1))) /* Do the rename operation using a recursive UPDATE statement that ** uses the sqlite_rename_column() SQL function to compute the new @@ -89304,11 +89912,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11014, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11196, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11076, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11258, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10044, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10106, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -89506,7 +90114,7 @@ func _unmapColumnIdlistNames(tls *libc.TLS, pParse uintptr, pIdList uintptr) { if !(ii < (*TIdList)(unsafe.Pointer(pIdList)).FnId) { break } - _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*(*TIdList_item)(unsafe.Pointer(pIdList + 8 + uintptr(ii)*16))).FzName) + _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*(*TIdList_item)(unsafe.Pointer(pIdList + 8 + uintptr(ii)*8))).FzName) goto _1 _1: ; @@ -89553,11 +90161,11 @@ func _renameUnmapSelectCb(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if !(i < (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) { break } - _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104))).FzName) - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 60 + 4))&0x400>>10)) == 0 { - _sqlite3WalkExpr(tls, pWalker, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 72))) + _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80))).FzName) + if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80 + 24 + 4))&0x800>>11) == 0 { + _sqlite3WalkExpr(tls, pWalker, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80 + 64))) } else { - _unmapColumnIdlistNames(tls, pParse, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 72))) + _unmapColumnIdlistNames(tls, pParse, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80 + 64))) } goto _2 _2: @@ -89784,11 +90392,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*uint8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11327 + v1 = __ccgo_ts + 11389 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11329, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11391, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -89840,7 +90448,7 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi if !(i < (*TIdList)(unsafe.Pointer(pIdList)).FnId) { break } - zName = (*(*TIdList_item)(unsafe.Pointer(pIdList + 8 + uintptr(i)*16))).FzName + zName = (*(*TIdList_item)(unsafe.Pointer(pIdList + 8 + uintptr(i)*8))).FzName if 0 == Xsqlite3_stricmp(tls, zName, zOld) { _renameTokenFind(tls, pParse, pCtx, zName) } @@ -89865,8 +90473,8 @@ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uin if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11352, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(117290)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11414, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118069)) } if bTemp != 0 { v1 = int32(1) @@ -89882,7 +90490,7 @@ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uin rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(117301)) + rc = _sqlite3CorruptError(tls, int32(118080)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -89921,7 +90529,7 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** 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 = _sqlite3MPrintf(tls, db, __ccgo_ts+11360, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11422, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { @@ -89966,11 +90574,11 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*uint8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = uint8(0) _sqlite3Dequote(tls, zBuf1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11327 + v1 = __ccgo_ts + 11389 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11366, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11428, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) } @@ -90095,9 +90703,9 @@ func _renameResolveTrigger(tls *libc.TLS, pParse uintptr) (r int32) { if !(i < (*TSrcList)(unsafe.Pointer((*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom)).FnSrc && rc == SQLITE_OK) { break } - p = (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom + 8 + uintptr(i)*104 - if (*TSrcItem)(unsafe.Pointer(p)).FpSelect != 0 { - _sqlite3SelectPrep(tls, pParse, (*TSrcItem)(unsafe.Pointer(p)).FpSelect, uintptr(0)) + p = (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom + 8 + uintptr(i)*80 + if int32(*(*uint32)(unsafe.Pointer(p + 24 + 4))&0x4>>2) != 0 { + _sqlite3SelectPrep(tls, pParse, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 72)))).FpSelect, uintptr(0)) } goto _3 _3: @@ -90155,8 +90763,8 @@ func _renameResolveTrigger(tls *libc.TLS, pParse uintptr) (r int32) { // */ func _renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { var i int32 - var pStep, pUpsert uintptr - _, _, _ = i, pStep, pUpsert + var pFrom, pStep, pUpsert uintptr + _, _, _, _ = i, pFrom, pStep, pUpsert /* Find tokens to edit in WHEN clause */ _sqlite3WalkExpr(tls, pWalker, (*TTrigger)(unsafe.Pointer(pTrigger)).FpWhen) /* Find tokens to edit in trigger steps */ @@ -90176,12 +90784,15 @@ func _renameWalkTrigger(tls *libc.TLS, pWalker uintptr, pTrigger uintptr) { _sqlite3WalkExpr(tls, pWalker, (*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertTargetWhere) } if (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 { + pFrom = (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom i = 0 for { - if !(i < (*TSrcList)(unsafe.Pointer((*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom)).FnSrc) { + if !(i < (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc) { break } - _sqlite3WalkSelect(tls, pWalker, (*(*TSrcItem)(unsafe.Pointer((*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom + 8 + uintptr(i)*104))).FpSelect) + if int32(*(*uint32)(unsafe.Pointer(pFrom + 8 + uintptr(i)*80 + 24 + 4))&0x4>>2) != 0 { + _sqlite3WalkSelect(tls, pWalker, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 8 + uintptr(i)*80 + 72)))).FpSelect) + } goto _2 _2: ; @@ -90455,7 +91066,7 @@ renameColumnFunc_done: Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv))) } else { if (*(*TParse)(unsafe.Pointer(bp + 32))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1662, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) + _renameColumnParseError(tls, context, __ccgo_ts+1663, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -90504,8 +91115,8 @@ func _renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) (r in if !(i < (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) { break } - pItem = pSrc + 8 + uintptr(i)*104 - if (*TSrcItem)(unsafe.Pointer(pItem)).FpTab == (*TRenameCtx)(unsafe.Pointer(p)).FpTab { + pItem = pSrc + 8 + uintptr(i)*80 + if (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab == (*TRenameCtx)(unsafe.Pointer(p)).FpTab { _renameTokenFind(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, p, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } goto _1 @@ -90653,7 +91264,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt if !(i < (*TSrcList)(unsafe.Pointer((*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom)).FnSrc) { break } - pItem = (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom + 8 + uintptr(i)*104 + pItem = (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom + 8 + uintptr(i)*80 if 0 == Xsqlite3_stricmp(tls, (*TSrcItem)(unsafe.Pointer(pItem)).FzName, zOld) { _renameTokenFind(tls, bp, bp+424, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } @@ -90681,7 +91292,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 3*8))) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1662, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) + _renameColumnParseError(tls, context, __ccgo_ts+1663, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -90943,7 +91554,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(118260)) + rc = _sqlite3CorruptError(tls, int32(119044)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -90960,7 +91571,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11371, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11433, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -91015,23 +91626,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10993, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11055, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11378 + v1 = __ccgo_ts + 11440 } else { - v1 = __ccgo_ts + 5653 + v1 = __ccgo_ts + 5670 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11390, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11452, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11418, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11480, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -91041,33 +91652,33 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol) != 0 { goto exit_drop_column } - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1662, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1663, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11466, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11528, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11587, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11649, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 52 + v3 = pParse + 56 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 56 + v5 = pParse + 60 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 56)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 56)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -91081,7 +91692,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 56 + v8 = pParse + 60 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -91152,29 +91763,29 @@ func _sqlite3AlterFunctions(tls *libc.TLS) { var _aAlterTableFuncs = [5]TFuncDef{ 0: { - FnArg: int8(9), + FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11605, + FzName: __ccgo_ts + 11667, }, 1: { - FnArg: int8(7), + FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11626, + FzName: __ccgo_ts + 11688, }, 2: { - FnArg: int8(7), + FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11646, + FzName: __ccgo_ts + 11708, }, 3: { - FnArg: int8(3), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11665, + FzName: __ccgo_ts + 11727, }, 4: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11684, + FzName: __ccgo_ts + 11746, }, } @@ -91385,7 +91996,7 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11787, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11849, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } @@ -91396,10 +92007,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11810, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11872, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11840, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11902, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -91431,15 +92042,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11707, - FzCols: __ccgo_ts + 11720, + FzName: __ccgo_ts + 11769, + FzCols: __ccgo_ts + 11782, }, 1: { - FzName: __ccgo_ts + 11733, - FzCols: __ccgo_ts + 11746, + FzName: __ccgo_ts + 11795, + FzCols: __ccgo_ts + 11808, }, 2: { - FzName: __ccgo_ts + 11774, + FzName: __ccgo_ts + 11836, }, } @@ -91739,9 +92350,9 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } var _statInitFuncdef = TFuncDef{ - FnArg: int8(4), + FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11858, + FzName: __ccgo_ts + 11920, } func init() { @@ -92113,9 +92724,9 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } var _statPushFuncdef = TFuncDef{ - FnArg: int8(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), + FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11868, + FzName: __ccgo_ts + 11930, } func init() { @@ -92165,7 +92776,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11878, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11940, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -92176,7 +92787,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11883, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11945, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -92215,7 +92826,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11889, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11951, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -92231,9 +92842,9 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } var _statGetFuncdef = TFuncDef{ - FnArg: int8(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), + FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11895, + FzName: __ccgo_ts + 11957, } func init() { @@ -92299,7 +92910,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11904, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+11966, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -92313,7 +92924,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11707, uint64(13)) + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11769, uint64(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -92546,7 +93157,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11914, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11976, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -92637,7 +93248,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11914, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11976, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -92674,7 +93285,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 52)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -92707,11 +93318,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 52)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11918) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11980) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11922) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11984) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -92840,7 +93451,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, _, _, _, _, _, _ = c, i, sz, v, z, v2 z = zIntArray if z == uintptr(0) { - z = __ccgo_ts + 1662 + z = __ccgo_ts + 1663 } i = 0 for { @@ -92875,17 +93486,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*uint8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+11926, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+11988, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+11937, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+11999, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+11947, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12009, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93118,12 +93729,13 @@ func _findIndexOrPrimaryKey(tls *libc.TLS, db uintptr, zName uintptr, zDb uintpt func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - var i, nByte, nCol, nIdxCol, nSample, rc int32 - var pIdx, pIdx1, pPrevIdx, pSample, pSpace, zIndex, zIndex1, zSql uintptr + var i, nByte Ti64 + var nCol, nIdxCol, nSample, rc int32 + var pIdx, pIdx1, pPrevIdx, pPtr, pSample, pSpace, zIndex, zIndex1, zSql uintptr var _ /* pStmt at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _ = i, nByte, nCol, nIdxCol, nSample, pIdx, pIdx1, pPrevIdx, pSample, pSpace, rc, zIndex, zIndex1, zSql /* Result codes from subroutines */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Text of the SQL statement */ - pPrevIdx = uintptr(0) /* A slot in pIdx->aSample[] */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = i, nByte, nCol, nIdxCol, nSample, pIdx, pIdx1, pPrevIdx, pPtr, pSample, pSpace, rc, zIndex, zIndex1, zSql /* Result codes from subroutines */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Text of the SQL statement */ + pPrevIdx = uintptr(0) /* A slot in pIdx->aSample[] */ zSql = _sqlite3MPrintf(tls, db, zSql1, libc.VaList(bp+16, zDb)) if !(zSql != 0) { return int32(SQLITE_NOMEM) @@ -93134,7 +93746,7 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u return rc } for Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { - nIdxCol = int32(1) + nIdxCol = int32(1) /* Available memory as a u8 for easier manipulation */ zIndex = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) if zIndex == uintptr(0) { continue @@ -93155,21 +93767,23 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u } (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample - nByte = libc.Int32FromUint64(uint64(40) * libc.Uint64FromInt32(nSample)) - nByte = int32(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = int32(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ - (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) + nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) return int32(SQLITE_NOMEM) } - pSpace = (*TIndex)(unsafe.Pointer(pIdx)).FaSample + uintptr(nSample)*40 + pPtr = (*TIndex)(unsafe.Pointer(pIdx)).FaSample + pPtr += uintptr((libc.Uint64FromInt32(nSample)*libc.Uint64FromInt64(40) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pSpace = pPtr (*TIndex)(unsafe.Pointer(pIdx)).FaAvgEq = pSpace pSpace += uintptr(nIdxCol) * 8 *(*Tu32)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable + 48)) |= uint32(TF_HasStat4) i = 0 for { - if !(i < nSample) { + if !(i < int64(nSample)) { break } (*(*TIndexSample)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSample + uintptr(i)*40))).FanEq = pSpace @@ -93261,11 +93875,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11733, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11795, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+11959, __ccgo_ts+12028, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12021, __ccgo_ts+12090, zDb) } return rc } @@ -93331,10 +93945,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11707, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11769, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12080, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12142, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -93447,7 +94061,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6649, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6711, zName) == 0) } // C documentation @@ -93489,21 +94103,21 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { zFile = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if zFile == uintptr(0) { - zFile = __ccgo_ts + 1662 + zFile = __ccgo_ts + 1663 } if zName == uintptr(0) { - zName = __ccgo_ts + 1662 + zName = __ccgo_ts + 1663 } if int32(uint32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x4>>2)) != 0 { /* 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 + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4031) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4032) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12121, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12183, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -93534,7 +94148,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12124, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12186, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -93543,7 +94157,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12161, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12223, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -93583,6 +94197,14 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) return } + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00020))<<libc.Int32FromInt32(32)) == uint64(0) { + *(*uint32)(unsafe.Pointer(bp + 16)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE))) + *(*uint32)(unsafe.Pointer(bp + 16)) |= uint32(SQLITE_OPEN_READONLY) + } else { + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00010))<<libc.Int32FromInt32(32)) == uint64(0) { + *(*uint32)(unsafe.Pointer(bp + 16)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_CREATE)) + } + } *(*uint32)(unsafe.Pointer(bp + 16)) |= uint32(SQLITE_OPEN_MAIN_DB) rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*uintptr)(unsafe.Pointer(bp)), db, pNew+8, 0, libc.Int32FromUint32(*(*uint32)(unsafe.Pointer(bp + 16)))) (*Tsqlite3)(unsafe.Pointer(db)).FnDb++ @@ -93591,7 +94213,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12191, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12253, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -93599,7 +94221,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12220, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12282, 0) rc = int32(SQLITE_ERROR) } } @@ -93643,10 +94265,10 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<<libc.Int32FromInt32(8) { _sqlite3OomFault(tls, db) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 24))) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1632, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1633, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12288, libc.VaList(bp+56, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12350, libc.VaList(bp+56, zFile)) } } } @@ -93688,7 +94310,7 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { pDb = uintptr(0) _ = NotUsed if zName == uintptr(0) { - zName = __ccgo_ts + 1662 + zName = __ccgo_ts + 1663 } i = 0 for { @@ -93708,15 +94330,15 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { i++ } if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12316, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12378, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12337, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12399, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12363, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12425, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -93809,9 +94431,9 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { } var _detach_func = TFuncDef{ - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12385, + FzName: __ccgo_ts + 12447, } func init() { @@ -93831,9 +94453,9 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p } var _attach_func = TFuncDef{ - FnArg: int8(3), + FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12399, + FzName: __ccgo_ts + 12461, } func init() { @@ -93859,7 +94481,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12413, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12475, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -93890,27 +94512,28 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if !(i < (*TSrcList)(unsafe.Pointer(pList)).FnSrc) { break } - if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 { - if (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0 { - if iDb != _sqlite3FindDbName(tls, db, (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12437, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase)) + if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { + if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12499, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } - _sqlite3DbFree(tls, db, (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase) - (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0) - libc.SetBitFieldPtr16Uint32(pItem+60+4, libc.Uint32FromInt32(1), 9, 0x200) + _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 10, 0x400) + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 17, 0x20000) } - (*TSrcItem)(unsafe.Pointer(pItem)).FpSchema = (*TDbFixer)(unsafe.Pointer(pFix)).FpSchema - libc.SetBitFieldPtr16Uint32(pItem+60+4, libc.Uint32FromInt32(1), 7, 0x80) + *(*uintptr)(unsafe.Pointer(pItem + 72)) = (*TDbFixer)(unsafe.Pointer(pFix)).FpSchema + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 8, 0x100) + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 16, 0x10000) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*104 + 60 + 4))&0x400>>10)) == 0 && _sqlite3WalkExpr(tls, pFix+8, *(*uintptr)(unsafe.Pointer(pList + 8 + uintptr(i)*104 + 72))) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pList + 8 + uintptr(i)*80 + 24 + 4))&0x800>>11) == 0 && _sqlite3WalkExpr(tls, pFix+8, *(*uintptr)(unsafe.Pointer(pList + 8 + uintptr(i)*80 + 64))) != 0 { return int32(WRC_Abort) } goto _1 _1: ; i++ - pItem += 104 + pItem += 80 } if (*TSelect)(unsafe.Pointer(pSelect)).FpWith != 0 { i = 0 @@ -94109,7 +94732,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12483, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12545, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -94137,11 +94760,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12506, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12568, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12512, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12574, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12518, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12580, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -94181,8 +94804,8 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if !(iSrc < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(iSrc)*104))).FiCursor { - pTab = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(iSrc)*104))).FpTab + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(iSrc)*80))).FiCursor { + pTab = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(iSrc)*80))).FpSTab break } goto _1 @@ -94201,7 +94824,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8030 + zCol = __ccgo_ts + 8092 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -94236,7 +94859,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12607, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -94657,21 +95280,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6649) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6711) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6589, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6616+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6635+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6130+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6597) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6678+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6147+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6659) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6635+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6130) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6147) } } } @@ -94701,12 +95324,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6589, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6635+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6130) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6147) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6616+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6597) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6678+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6659) } } } @@ -94744,7 +95367,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12560, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12622, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -94762,15 +95385,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12568 + v1 = __ccgo_ts + 12630 } else { - v1 = __ccgo_ts + 12581 + v1 = __ccgo_ts + 12643 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6853, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6924, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6986, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -94792,11 +95415,11 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt var iDb int32 var zDb uintptr _, _ = iDb, zDb - if (*TSrcItem)(unsafe.Pointer(p)).FpSchema != 0 { - iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(p)).FpSchema) + if int32(*(*uint32)(unsafe.Pointer(p + 24 + 4))&0x10000>>16) != 0 { + iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(p + 72))) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - zDb = (*TSrcItem)(unsafe.Pointer(p)).FzDatabase + zDb = *(*uintptr)(unsafe.Pointer(p + 72)) } return _sqlite3LocateTable(tls, pParse, flags, (*TSrcItem)(unsafe.Pointer(p)).FzName, zDb) } @@ -94808,12 +95431,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6589, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6130+7) == 0 { - return __ccgo_ts + 6635 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6147+7) == 0 { + return __ccgo_ts + 6697 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6597+7) == 0 { - return __ccgo_ts + 6616 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6659+7) == 0 { + return __ccgo_ts + 6678 } } return zName @@ -95338,7 +95961,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6130) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6147) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -95370,7 +95993,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "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, __ccgo_ts+6649, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6711, zName) { break } goto _1 @@ -95428,13 +96051,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12595, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12657, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12612, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12674, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -95478,12 +96101,12 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit))) != 0 || Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 1*8))) != 0 || Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 2*8))) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1662, 0) /* corruptSchema() will supply the error */ + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1663, 0) /* corruptSchema() will supply the error */ return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6589, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12632, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12694, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -95655,7 +96278,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -95698,9 +96321,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6597 + v1 = __ccgo_ts + 6659 } else { - v1 = __ccgo_ts + 6130 + v1 = __ccgo_ts + 6147 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -95713,7 +96336,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12674, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12736, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -95729,9 +96352,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10921 + v2 = __ccgo_ts + 10983 } else { - v2 = __ccgo_ts + 9183 + v2 = __ccgo_ts + 9245 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -95741,9 +96364,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6597 + v3 = __ccgo_ts + 6659 } else { - v3 = __ccgo_ts + 6130 + v3 = __ccgo_ts + 6147 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -95767,11 +96390,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 10921 + v4 = __ccgo_ts + 10983 } else { - v4 = __ccgo_ts + 9183 + v4 = __ccgo_ts + 9245 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12715, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12777, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -95779,7 +96402,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12736, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12798, libc.VaList(bp+16, zName)) goto begin_table_error } } @@ -95815,19 +96438,19 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 56 + v9 = pParse + 60 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 reg1 = v7 - v12 = pParse + 56 + v12 = pParse + 60 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 reg2 = v10 - v14 = pParse + 56 + v14 = pParse + 60 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -95931,7 +96554,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12771, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12833, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -95947,7 +96570,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12805, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12867, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -95994,7 +96617,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12825, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12887, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -96004,12 +96627,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12848, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12910, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12855, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12917, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -96058,7 +96681,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok break } if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12865, libc.VaList(bp+40, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12927, libc.VaList(bp+40, z)) _sqlite3DbFree(tls, db, z) return } @@ -96266,10 +96889,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12953, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12936, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12998, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -96327,7 +96950,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12977, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13039, 0) } } @@ -96364,7 +96987,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13029, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13091, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -96420,7 +97043,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13070, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13132, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -96536,17 +97159,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13126, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13188, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13169, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13231, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13177, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13239, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -96578,7 +97201,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13184, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -96741,13 +97364,13 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { } n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) if n < int32(50) { - zSep = __ccgo_ts + 1662 - zSep2 = __ccgo_ts + 13215 - zEnd = __ccgo_ts + 5170 + zSep = __ccgo_ts + 1663 + zSep2 = __ccgo_ts + 13277 + zEnd = __ccgo_ts + 5171 } else { - zSep = __ccgo_ts + 13217 - zSep2 = __ccgo_ts + 13221 - zEnd = __ccgo_ts + 13226 + zSep = __ccgo_ts + 13279 + zSep2 = __ccgo_ts + 13283 + zEnd = __ccgo_ts + 13288 } n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) @@ -96755,7 +97378,7 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13229, 0) + Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13291, 0) *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) @@ -96781,17 +97404,17 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3859, libc.VaList(bp+16, zEnd)) + Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3860, libc.VaList(bp+16, zEnd)) return zStmt } var _azType1 = [6]uintptr{ - 0: __ccgo_ts + 1662, - 1: __ccgo_ts + 13243, - 2: __ccgo_ts + 13249, - 3: __ccgo_ts + 13254, - 4: __ccgo_ts + 13259, - 5: __ccgo_ts + 13249, + 0: __ccgo_ts + 1663, + 1: __ccgo_ts + 13305, + 2: __ccgo_ts + 13311, + 3: __ccgo_ts + 13316, + 4: __ccgo_ts + 13321, + 5: __ccgo_ts + 13311, } // C documentation @@ -97393,7 +98016,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if pSelect != 0 || !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1662, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1663, 0) return } (*TTable)(unsafe.Pointer(p)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum @@ -97420,9 +98043,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13265, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1662))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13327, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1663))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13298, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13360, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -97443,11 +98066,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13325, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13387, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13375, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13437, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -97494,7 +98117,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13407, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13469, 0) return } } @@ -97528,12 +98151,12 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9183 - zType2 = __ccgo_ts + 13451 + zType = __ccgo_ts + 9245 + zType2 = __ccgo_ts + 13513 } else { /* A view */ - zType = __ccgo_ts + 10921 - zType2 = __ccgo_ts + 13457 + zType = __ccgo_ts + 10983 + zType2 = __ccgo_ts + 13519 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the @@ -97554,19 +98177,19 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 52 + v5 = pParse + 56 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 56 + v7 = pParse + 60 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 56 + v9 = pParse + 60 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 56 + v11 = pParse + 60 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 @@ -97619,13 +98242,13 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13462, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13524, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13477, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13539, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -97634,15 +98257,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13575, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13637, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13617, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13679, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13651, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13713, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -97660,7 +98283,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* 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 libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9705) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9767) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -97693,7 +98316,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13672, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13734, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -97710,7 +98333,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+10921, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+10983, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -97807,7 +98430,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13708, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13770, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -97991,7 +98614,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13738, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13800, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -98004,7 +98627,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13753, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13815, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -98087,9 +98710,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13820, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13882, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11810, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11872, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -98130,7 +98753,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13834, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13896, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -98139,7 +98762,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13879, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13941, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -98174,11 +98797,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6589, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3482, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3483, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7391, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7453, int32(10)) == 0 { return 0 } return int32(1) @@ -98220,7 +98843,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 } if pTab == uintptr(0) { if noErr != 0 { - _sqlite3CodeVerifyNamedSchema(tls, pParse, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzDatabase) + _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } goto exit_drop_table @@ -98233,9 +98856,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6597 + v1 = __ccgo_ts + 6659 } else { - v1 = __ccgo_ts + 6130 + v1 = __ccgo_ts + 6147 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -98268,18 +98891,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13946, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14008, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13974, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14036, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14008, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14070, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -98289,7 +98912,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11922, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11984, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -98337,13 +98960,13 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14040, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14102, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14103, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14165, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr @@ -98406,7 +99029,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14197, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14259, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -98521,11 +99144,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 52 + v2 = pParse + 56 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 52 + v4 = pParse + 56 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -98547,7 +99170,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 52 + v6 = pParse + 56 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -98666,11 +99289,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14243 + v2 = __ccgo_ts + 14305 } else { - v2 = __ccgo_ts + 14249 + v2 = __ccgo_ts + 14311 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14254, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14316, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -98748,7 +99371,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14282, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14344, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -98758,7 +99381,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14288, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14350, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -98772,16 +99395,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6589, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14338, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14400, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14366, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14428, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14391, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14453, 0) goto exit_create_index } /* @@ -98802,19 +99425,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14282, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14344, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14425, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14487, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14459, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14521, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -98835,7 +99458,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14483, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14545, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -98853,9 +99476,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6597 + v2 = __ccgo_ts + 6659 } else { - v2 = __ccgo_ts + 6130 + v2 = __ccgo_ts + 6147 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -98883,7 +99506,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14282) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14344) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -98967,7 +99590,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14506, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14568, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -99114,7 +99737,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14567, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14629, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -99144,8 +99767,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14609, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(125747)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14671, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) goto exit_create_index } } @@ -99158,7 +99781,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 56 + v12 = pParse + 60 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -99185,11 +99808,11 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* A named index with an explicit CREATE INDEX statement */ if onError == OE_None { - v13 = __ccgo_ts + 1662 + v13 = __ccgo_ts + 1663 } else { - v13 = __ccgo_ts + 14626 + v13 = __ccgo_ts + 14688 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14634, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14696, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -99197,7 +99820,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14654, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14716, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -99205,7 +99828,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14713, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14775, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -99365,19 +99988,19 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in if SQLITE_OK != _sqlite3ReadSchema(tls, pParse) { goto exit_drop_index } - pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzDatabase) + pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14740, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14802, libc.VaList(bp+8, pName+8)) } else { - _sqlite3CodeVerifyNamedSchema(tls, pParse, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzDatabase) + _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14758, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14820, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -99385,9 +100008,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6597 + v1 = __ccgo_ts + 6659 } else { - v1 = __ccgo_ts + 6130 + v1 = __ccgo_ts + 6147 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -99403,8 +100026,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14831, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11918, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14893, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11980, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -99477,12 +100100,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(24)) + pList = _sqlite3DbMallocZero(tls, db, uint64(16)) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(24)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(16)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -99493,9 +100116,9 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ i = v1 - (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*16))).FzName = _sqlite3NameFromToken(tls, db, pToken) - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*16))).FzName != 0 { - _sqlite3RenameTokenMap(tls, pParse, (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*16))).FzName, pToken) + (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*8))).FzName = _sqlite3NameFromToken(tls, db, pToken) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*8))).FzName != 0 { + _sqlite3RenameTokenMap(tls, pParse, (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*8))).FzName, pToken) } return pList } @@ -99511,13 +100134,12 @@ func _sqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr) { if pList == uintptr(0) { return } - /* EU4_EXPR mode is not currently used */ i = 0 for { if !(i < (*TIdList)(unsafe.Pointer(pList)).FnId) { break } - _sqlite3DbFree(tls, db, (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*16))).FzName) + _sqlite3DbFree(tls, db, (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*8))).FzName) goto _1 _1: ; @@ -99540,7 +100162,7 @@ func _sqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) (r int32) if !(i < (*TIdList)(unsafe.Pointer(pList)).FnId) { break } - if _sqlite3StrICmp(tls, (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*16))).FzName, zName) == 0 { + if _sqlite3StrICmp(tls, (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*8))).FzName, zName) == 0 { return i } goto _1 @@ -99595,13 +100217,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14891, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14953, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(112)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(104)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -99615,7 +100237,7 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra if !(i >= iStart) { break } - *(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+nExtra)*104)) = *(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104)) + *(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+nExtra)*80)) = *(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80)) goto _1 _1: ; @@ -99623,13 +100245,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra } *(*int32)(unsafe.Pointer(pSrc)) += nExtra /* Zero the newly allocated slots */ - libc.Xmemset(tls, pSrc+8+uintptr(iStart)*104, 0, uint64(104)*libc.Uint64FromInt32(nExtra)) + libc.Xmemset(tls, pSrc+8+uintptr(iStart)*80, 0, uint64(80)*libc.Uint64FromInt32(nExtra)) i = iStart for { if !(i < iStart+nExtra) { break } - (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104))).FiCursor = -int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80))).FiCursor = -int32(1) goto _2 _2: ; @@ -99682,13 +100304,13 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(112)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) if pList == uintptr(0) { return uintptr(0) } (*TSrcList)(unsafe.Pointer(pList)).FnAlloc = uint32(1) (*TSrcList)(unsafe.Pointer(pList)).FnSrc = int32(1) - libc.Xmemset(tls, pList+8, 0, uint64(104)) + libc.Xmemset(tls, pList+8, 0, uint64(80)) (*(*TSrcItem)(unsafe.Pointer(pList + 8))).FiCursor = -int32(1) } else { pNew = _sqlite3SrcListEnlarge(tls, pParse, pList, int32(1), (*TSrcList)(unsafe.Pointer(pList)).FnSrc) @@ -99699,16 +100321,16 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable pList = pNew } } - pItem = pList + 8 + uintptr((*TSrcList)(unsafe.Pointer(pList)).FnSrc-int32(1))*104 + pItem = pList + 8 + uintptr((*TSrcList)(unsafe.Pointer(pList)).FnSrc-int32(1))*80 if pDatabase != 0 && (*TToken)(unsafe.Pointer(pDatabase)).Fz == uintptr(0) { pDatabase = uintptr(0) } if pDatabase != 0 { (*TSrcItem)(unsafe.Pointer(pItem)).FzName = _sqlite3NameFromToken(tls, db, pDatabase) - (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase = _sqlite3NameFromToken(tls, db, pTable) + *(*uintptr)(unsafe.Pointer(pItem + 72)) = _sqlite3NameFromToken(tls, db, pTable) } else { (*TSrcItem)(unsafe.Pointer(pItem)).FzName = _sqlite3NameFromToken(tls, db, pTable) - (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase = uintptr(0) + *(*uintptr)(unsafe.Pointer(pItem + 72)) = uintptr(0) } return pList } @@ -99732,18 +100354,18 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 52 + v3 = pParse + 56 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 - if (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 { - _sqlite3SrcListAssignCursors(tls, pParse, (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpSrc) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { + _sqlite3SrcListAssignCursors(tls, pParse, (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect)).FpSrc) } goto _1 _1: ; i++ - pItem += 104 + pItem += 80 } } } @@ -99751,6 +100373,32 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) // C documentation // // /* +// ** Delete a Subquery object and its substructure. +// */ +func _sqlite3SubqueryDelete(tls *libc.TLS, db uintptr, pSubq uintptr) { + _sqlite3SelectDelete(tls, db, (*TSubquery)(unsafe.Pointer(pSubq)).FpSelect) + _sqlite3DbFree(tls, db, pSubq) +} + +// C documentation +// +// /* +// ** Remove a Subquery from a SrcItem. Return the associated Select object. +// ** The returned Select becomes the responsibility of the caller. +// */ +func _sqlite3SubqueryDetach(tls *libc.TLS, db uintptr, pItem uintptr) (r uintptr) { + var pSel uintptr + _ = pSel + pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect + _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) + *(*uintptr)(unsafe.Pointer(pItem + 72)) = uintptr(0) + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(0), 2, 0x4) + return pSel +} + +// C documentation +// +// /* // ** Delete an entire SrcList including all its substructure. // */ func _sqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { @@ -99766,37 +100414,39 @@ func _sqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { if !(i < (*TSrcList)(unsafe.Pointer(pList)).FnSrc) { break } - if (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase != 0 { - _sqlite3DbNNFreeNN(tls, db, (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase) - } + /* Check invariants on SrcItem */ if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { _sqlite3DbNNFreeNN(tls, db, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } if (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias != 0 { _sqlite3DbNNFreeNN(tls, db, (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2>>1)) != 0 { - _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 88))) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { + _sqlite3SubqueryDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) + } else { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { + _sqlite3DbNNFreeNN(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) + } } - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x4>>2)) != 0 { - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 88))) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x2>>1) != 0 { + _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 48))) } - _sqlite3DeleteTable(tls, db, (*TSrcItem)(unsafe.Pointer(pItem)).FpTab) - if (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect != 0 { - _sqlite3SelectDelete(tls, db, (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x8>>3) != 0 { + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 48))) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x400>>10)) != 0 { - _sqlite3IdListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) + _sqlite3DeleteTable(tls, db, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) != 0 { + _sqlite3IdListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 64))) } else { - if *(*uintptr)(unsafe.Pointer(pItem + 72)) != 0 { - _sqlite3ExprDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) + if *(*uintptr)(unsafe.Pointer(pItem + 64)) != 0 { + _sqlite3ExprDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 64))) } } goto _1 _1: ; i++ - pItem += 104 + pItem += 80 } _sqlite3DbNNFreeNN(tls, db, pList) } @@ -99804,6 +100454,54 @@ func _sqlite3SrcListDelete(tls *libc.TLS, db uintptr, pList uintptr) { // C documentation // // /* +// ** Attach a Subquery object to pItem->uv.pSubq. Set the +// ** pSelect value but leave all the other values initialized +// ** to zero. +// ** +// ** A copy of the Select object is made if dupSelect is true, and the +// ** SrcItem takes responsibility for deleting the copy. If dupSelect is +// ** false, ownership of the Select passes to the SrcItem. Either way, +// ** the SrcItem will take responsibility for deleting the Select. +// ** +// ** When dupSelect is zero, that means the Select might get deleted right +// ** away if there is an OOM error. Beware. +// ** +// ** Return non-zero on success. Return zero on an OOM error. +// */ +func _sqlite3SrcItemAttachSubquery(tls *libc.TLS, pParse uintptr, pItem uintptr, pSelect uintptr, dupSelect int32) (r int32) { + var p, v1 uintptr + _, _ = p, v1 + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) != 0 { + *(*uintptr)(unsafe.Pointer(pItem + 72)) = uintptr(0) + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(0), 16, 0x10000) + } else { + if *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { + _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pItem + 72))) + *(*uintptr)(unsafe.Pointer(pItem + 72)) = uintptr(0) + } + } + if dupSelect != 0 { + pSelect = _sqlite3SelectDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSelect, 0) + if pSelect == uintptr(0) { + return 0 + } + } + v1 = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(24)) + *(*uintptr)(unsafe.Pointer(pItem + 72)) = v1 + p = v1 + if p == uintptr(0) { + _sqlite3SelectDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSelect) + return 0 + } + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 2, 0x4) + (*TSubquery)(unsafe.Pointer(p)).FpSelect = pSelect + libc.Xmemset(tls, p+uintptr(8), 0, libc.Uint64FromInt64(24)-libc.Uint64FromInt64(8)) + return int32(1) +} + +// C documentation +// +// /* // ** This routine is called by the parser to add a new term to the // ** end of a growing FROM clause. The "p" parameter is the part of // ** the FROM clause that has already been constructed. "p" is NULL @@ -99827,18 +100525,18 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 14927 + v1 = __ccgo_ts + 14989 } else { - v1 = __ccgo_ts + 14930 + v1 = __ccgo_ts + 14992 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14936, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14998, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) if p == uintptr(0) { goto append_from_error } - pItem = p + 8 + uintptr((*TSrcList)(unsafe.Pointer(p)).FnSrc-int32(1))*104 + pItem = p + 8 + uintptr((*TSrcList)(unsafe.Pointer(p)).FnSrc-int32(1))*80 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) && (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if pDatabase != 0 && (*TToken)(unsafe.Pointer(pDatabase)).Fz != 0 { v2 = pDatabase @@ -99852,19 +100550,20 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa (*TSrcItem)(unsafe.Pointer(pItem)).FzAlias = _sqlite3NameFromToken(tls, db, pAlias) } if pSubquery != 0 { - (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect = pSubquery - if (*TSelect)(unsafe.Pointer(pSubquery)).FselFlags&uint32(SF_NestedFrom) != 0 { - libc.SetBitFieldPtr16Uint32(pItem+60+4, libc.Uint32FromInt32(1), 13, 0x2000) + if _sqlite3SrcItemAttachSubquery(tls, pParse, pItem, pSubquery, 0) != 0 { + if (*TSelect)(unsafe.Pointer(pSubquery)).FselFlags&uint32(SF_NestedFrom) != 0 { + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 14, 0x4000) + } } } if pOnUsing == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pItem + 72)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(pItem + 64)) = uintptr(0) } else { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0 { - libc.SetBitFieldPtr16Uint32(pItem+60+4, libc.Uint32FromInt32(1), 10, 0x400) - *(*uintptr)(unsafe.Pointer(pItem + 72)) = (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 11, 0x800) + *(*uintptr)(unsafe.Pointer(pItem + 64)) = (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing } else { - *(*uintptr)(unsafe.Pointer(pItem + 72)) = (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn + *(*uintptr)(unsafe.Pointer(pItem + 64)) = (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn } } return p @@ -99886,14 +100585,14 @@ func _sqlite3SrcListIndexedBy(tls *libc.TLS, pParse uintptr, p uintptr, pIndexed var pItem uintptr _ = pItem if p != 0 && (*TToken)(unsafe.Pointer(pIndexedBy)).Fn > uint32(0) { - pItem = p + 8 + uintptr((*TSrcList)(unsafe.Pointer(p)).FnSrc-int32(1))*104 + pItem = p + 8 + uintptr((*TSrcList)(unsafe.Pointer(p)).FnSrc-int32(1))*80 if (*TToken)(unsafe.Pointer(pIndexedBy)).Fn == uint32(1) && !((*TToken)(unsafe.Pointer(pIndexedBy)).Fz != 0) { /* A "NOT INDEXED" clause was supplied. See parse.y ** construct "indexed_opt" for details. */ - libc.SetBitFieldPtr16Uint32(pItem+60+4, libc.Uint32FromInt32(1), 0, 0x1) + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 0, 0x1) } else { - *(*uintptr)(unsafe.Pointer(pItem + 88)) = _sqlite3NameFromToken(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIndexedBy) - libc.SetBitFieldPtr16Uint32(pItem+60+4, libc.Uint32FromInt32(1), 1, 0x2) + *(*uintptr)(unsafe.Pointer(pItem + 48)) = _sqlite3NameFromToken(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIndexedBy) + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 1, 0x2) /* No collision on union u2 */ } } @@ -99915,10 +100614,10 @@ func _sqlite3SrcListAppendList(tls *libc.TLS, pParse uintptr, p1 uintptr, p2 uin _sqlite3SrcListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, p2) } else { p1 = pNew - libc.Xmemcpy(tls, p1+8+1*104, p2+8, libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p2)).FnSrc)*uint64(104)) + libc.Xmemcpy(tls, p1+8+1*80, p2+8, libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p2)).FnSrc)*uint64(80)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, p2) - p11 = p1 + 8 + 60 - *(*Tu8)(unsafe.Pointer(p11)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p11))) | libc.Int32FromInt32(JT_LTORJ)&libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(p1 + 8 + 1*104))).Ffg.Fjointype)) + p11 = p1 + 8 + 24 + *(*Tu8)(unsafe.Pointer(p11)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p11))) | libc.Int32FromInt32(JT_LTORJ)&libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(p1 + 8 + 1*80))).Ffg.Fjointype)) } } return p1 @@ -99934,9 +100633,9 @@ func _sqlite3SrcListFuncArgs(tls *libc.TLS, pParse uintptr, p uintptr, pList uin var pItem uintptr _ = pItem if p != 0 { - pItem = p + 8 + uintptr((*TSrcList)(unsafe.Pointer(p)).FnSrc-int32(1))*104 - *(*uintptr)(unsafe.Pointer(pItem + 88)) = pList - libc.SetBitFieldPtr16Uint32(pItem+60+4, libc.Uint32FromInt32(1), 2, 0x4) + pItem = p + 8 + uintptr((*TSrcList)(unsafe.Pointer(p)).FnSrc-int32(1))*80 + *(*uintptr)(unsafe.Pointer(pItem + 48)) = pList + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 3, 0x8) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pList) } @@ -99976,8 +100675,8 @@ func _sqlite3SrcListShiftJoinType(tls *libc.TLS, pParse uintptr, p uintptr) { i = (*TSrcList)(unsafe.Pointer(p)).FnSrc - int32(1) allFlags = uint8(0) for { - v3 = (*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i-int32(1))*104))).Ffg.Fjointype - (*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i)*104))).Ffg.Fjointype = v3 + v3 = (*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i-int32(1))*80))).Ffg.Fjointype + (*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i)*80))).Ffg.Fjointype = v3 allFlags = Tu8(int32(allFlags) | libc.Int32FromUint8(v3)) goto _2 _2: @@ -99994,7 +100693,7 @@ func _sqlite3SrcListShiftJoinType(tls *libc.TLS, pParse uintptr, p uintptr) { if libc.Int32FromUint8(allFlags)&int32(JT_RIGHT) != 0 { i = (*TSrcList)(unsafe.Pointer(p)).FnSrc - int32(1) for { - if !(i > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i)*104))).Ffg.Fjointype)&int32(JT_RIGHT) == 0) { + if !(i > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(p + 8 + uintptr(i)*80))).Ffg.Fjointype)&int32(JT_RIGHT) == 0) { break } goto _4 @@ -100004,7 +100703,7 @@ func _sqlite3SrcListShiftJoinType(tls *libc.TLS, pParse uintptr, p uintptr) { } i-- for { - p7 = p + 8 + uintptr(i)*104 + 60 + p7 = p + 8 + uintptr(i)*80 + 24 *(*Tu8)(unsafe.Pointer(p7)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p7))) | libc.Int32FromInt32(JT_LTORJ)) goto _6 _6: @@ -100029,7 +100728,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+14972, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15034, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -100076,9 +100775,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 14978 + v1 = __ccgo_ts + 15040 } else { - v1 = __ccgo_ts + 14987 + v1 = __ccgo_ts + 15049 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -100110,9 +100809,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 14972, - 1: __ccgo_ts + 14994, - 2: __ccgo_ts + 14978, + 0: __ccgo_ts + 15034, + 1: __ccgo_ts + 15056, + 2: __ccgo_ts + 15040, } // C documentation @@ -100132,7 +100831,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15002, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15064, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -100316,7 +101015,7 @@ func _sqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable _sqlite3StrAccumInit(tls, bp, (*TParse)(unsafe.Pointer(pParse)).Fdb, uintptr(0), 0, *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136))) if (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+15072, libc.VaList(bp+40, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+15134, libc.VaList(bp+40, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) } else { j = 0 for { @@ -100325,10 +101024,10 @@ func _sqlite3UniqueConstraint(tls *libc.TLS, pParse uintptr, onError int32, pIdx } zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)))*16))).FzCnName if j != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+15083, int32(2)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+15145, int32(2)) } Xsqlite3_str_appendall(tls, bp, (*TTable)(unsafe.Pointer(pTab)).FzName) - Xsqlite3_str_append(tls, bp, __ccgo_ts+1675, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+1676, int32(1)) Xsqlite3_str_appendall(tls, bp, zCol) goto _1 _1: @@ -100357,10 +101056,10 @@ func _sqlite3RowidConstraint(tls *libc.TLS, pParse uintptr, onError int32, pTab var zMsg uintptr _, _ = rc, zMsg if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12506, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<<libc.Int32FromInt32(8) } else { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+15086, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+15148, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(10)<<libc.Int32FromInt32(8) } _sqlite3HaltConstraint(tls, pParse, rc, onError, zMsg, int8(-libc.Int32FromInt32(6)), uint8(P5_ConstraintUnique)) @@ -100535,7 +101234,7 @@ func _sqlite3Reindex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintp _sqlite3RefillIndex(tls, pParse, pIndex, -int32(1)) return } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15095, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15157, 0) } // C documentation @@ -100671,7 +101370,7 @@ func _sqlite3WithAdd(tls *libc.TLS, pParse uintptr, pWith uintptr, pCte uintptr) break } if _sqlite3StrICmp(tls, zName, (*(*TCte)(unsafe.Pointer(pWith + 16 + uintptr(i)*48))).FzName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15141, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15203, libc.VaList(bp+8, zName)) } goto _1 _1: @@ -100970,7 +101669,7 @@ func _sqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc Tu8, pColl uintptr, z p = uintptr(0) } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15171, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15233, libc.VaList(bp+8, zName)) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } return p @@ -101058,6 +101757,13 @@ func _matchQuality(tls *libc.TLS, p uintptr, nArg int32, enc Tu8) (r int32) { if int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) >= 0 { return 0 } + /* Special p->nArg values available to built-in functions only: + ** -3 1 or more arguments required + ** -4 2 or more arguments required + */ + if int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) < -int32(2) && nArg < -int32(2)-int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) { + return 0 + } } /* Give a better score to a function with a specific number of arguments ** than to function that accepts any number of arguments. */ @@ -101210,7 +101916,7 @@ func _sqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, } if v2 && v1 != uintptr(0) { (*TFuncDef)(unsafe.Pointer(pBest)).FzName = pBest + 1*72 - (*TFuncDef)(unsafe.Pointer(pBest)).FnArg = libc.Int8FromUint16(libc.Uint16FromInt32(nArg)) + (*TFuncDef)(unsafe.Pointer(pBest)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) (*TFuncDef)(unsafe.Pointer(pBest)).FfuncFlags = uint32(enc) libc.Xmemcpy(tls, pBest+1*72, zName, libc.Uint64FromInt32(nName+int32(1))) z = (*TFuncDef)(unsafe.Pointer(pBest)).FzName @@ -101356,8 +102062,8 @@ func _sqlite3SchemaGet(tls *libc.TLS, db uintptr, pBt uintptr) (r uintptr) { // ** // ** The following fields are initialized appropriate in pSrc: // ** -// ** pSrc->a[0].pTab Pointer to the Table object -// ** pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one +// ** pSrc->a[0].spTab Pointer to the Table object +// ** pSrc->a[0].u2.pIBIndex Pointer to the INDEXED BY index, if there is one // ** // */ func _sqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) (r uintptr) { @@ -101365,14 +102071,14 @@ func _sqlite3SrcListLookup(tls *libc.TLS, pParse uintptr, pSrc uintptr) (r uintp _, _ = pItem, pTab pItem = pSrc + 8 pTab = _sqlite3LocateTableItem(tls, pParse, uint32(0), pItem) - if (*TSrcItem)(unsafe.Pointer(pItem)).FpTab != 0 { - _sqlite3DeleteTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pItem)).FpTab) + if (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab != 0 { + _sqlite3DeleteTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab) } - (*TSrcItem)(unsafe.Pointer(pItem)).FpTab = pTab - libc.SetBitFieldPtr16Uint32(pItem+60+4, libc.Uint32FromInt32(1), 9, 0x200) + (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = pTab + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 10, 0x400) if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2>>1)) != 0 && _sqlite3IndexedByLookup(tls, pParse, pItem) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x2>>1) != 0 && _sqlite3IndexedByLookup(tls, pParse, pItem) != 0 { pTab = uintptr(0) } } @@ -101429,7 +102135,7 @@ func _vtabIsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15202, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -101463,11 +102169,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15235, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15297, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15326, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -101493,7 +102199,7 @@ func _sqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWher pFrom = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if pFrom != 0 { (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pView)).FzName) - (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzDatabase = _sqlite3DbStrDup(tls, db, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + *(*uintptr)(unsafe.Pointer(pFrom + 8 + 72)) = _sqlite3DbStrDup(tls, db, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) } pSel = _sqlite3SelectNew(tls, pParse, uintptr(0), pFrom, pWhere, uintptr(0), uintptr(0), pOrderBy, uint32(SF_IncludeHidden), pLimit) _sqlite3SelectDestInit(tls, bp, int32(SRT_EphemTab), iCur) @@ -101571,7 +102277,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 52 + v3 = pParse + 56 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -101628,7 +102334,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { - v7 = pParse + 56 + v7 = pParse + 60 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) memCnt = v6 @@ -101689,7 +102395,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { /* For a rowid table, initialize the RowSet to an empty set */ pPk = uintptr(0) - v13 = pParse + 56 + v13 = pParse + 60 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) iRowSet = v12 @@ -101700,8 +102406,8 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int16FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(nPk) - v15 = pParse + 52 + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(nPk) + v15 = pParse + 56 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ iEphCur = v14 @@ -101746,7 +102452,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } iKey = iPk } else { - v18 = pParse + 56 + v18 = pParse + 60 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) iKey = v17 @@ -101777,7 +102483,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } else { if pPk != 0 { /* Add the PK key for this row to the temporary table */ - v20 = pParse + 56 + v20 = pParse + 60 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) iKey = v19 @@ -101870,7 +102576,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** invoke the callback function. */ if memCnt != 0 { - _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15302) + _sqlite3CodeChangeCount(tls, v, memCnt, __ccgo_ts+15364) } goto delete_from_cleanup delete_from_cleanup: @@ -101961,7 +102667,7 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri mask = _sqlite3TriggerColmask(tls, pParse, pTrigger, uintptr(0), 0, libc.Int32FromInt32(TRIGGER_BEFORE)|libc.Int32FromInt32(TRIGGER_AFTER), pTab, libc.Int32FromUint8(onconf)) mask |= _sqlite3FkOldmask(tls, pParse, pTab) iOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(1) + int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(1) + int32((*TTable)(unsafe.Pointer(pTab)).FnCol) /* Populate the OLD.* pseudo-table register array. These values will be ** used by any BEFORE and AFTER triggers that exist. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Copy), iPk, iOld) @@ -102018,7 +102724,7 @@ func _sqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTri v3 = 0 } _sqlite3VdbeAddOp2(tls, v, int32(OP_Delete), iDataCur, v3) - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 || 0 == Xsqlite3_stricmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11707) { + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 || 0 == Xsqlite3_stricmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11769) { _sqlite3VdbeAppendP4(tls, v, pTab, -int32(5)) } if libc.Int32FromUint8(eMode) != ONEPASS_OFF { @@ -102322,11 +103028,11 @@ func _typeofFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { } var _azType2 = [5]uintptr{ - 0: __ccgo_ts + 6370, - 1: __ccgo_ts + 6365, - 2: __ccgo_ts + 8322, - 3: __ccgo_ts + 8317, - 4: __ccgo_ts + 1648, + 0: __ccgo_ts + 6387, + 1: __ccgo_ts + 6382, + 2: __ccgo_ts + 8384, + 3: __ccgo_ts + 8379, + 4: __ccgo_ts + 1649, } // C documentation @@ -102440,7 +103146,7 @@ func _absFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { /* 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, __ccgo_ts+15315, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15377, -int32(1)) return } iVal = -iVal @@ -102594,16 +103300,15 @@ func _printfFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** If p2 is negative, return the p2 characters preceding p1. // */ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - var len1, negP2, p0type int32 - var p1, p2 Ti64 + var len1, p0type int32 + var p1, p2, v6 Ti64 var z, z2, v2, v3, v5 uintptr - _, _, _, _, _, _, _, _, _, _ = len1, negP2, p0type, p1, p2, z, z2, v2, v3, v5 - negP2 = 0 + _, _, _, _, _, _, _, _, _, _ = len1, p0type, p1, p2, z, z2, v2, v3, v5, v6 if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == int32(SQLITE_NULL) || argc == int32(3) && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) == int32(SQLITE_NULL) { return } p0type = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv))) - p1 = int64(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) + p1 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if p0type == int32(SQLITE_BLOB) { len1 = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) z = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -102637,20 +103342,17 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } if argc == int32(3) { - p2 = int64(Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - if p2 < 0 { - p2 = -p2 - negP2 = int32(1) - } + p2 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8))) } else { p2 = int64(*(*int32)(unsafe.Pointer(Xsqlite3_context_db_handle(tls, context) + 136))) } if p1 < 0 { p1 += int64(len1) if p1 < 0 { - p2 += p1 if p2 < 0 { p2 = 0 + } else { + p2 += p1 } p1 = 0 } @@ -102663,12 +103365,13 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } } } - if negP2 != 0 { - p1 -= p2 - if p1 < 0 { - p2 += p1 - p1 = 0 + if p2 < 0 { + if p2 < -p1 { + p2 = p1 + } else { + p2 = -p2 } + p1 -= p2 } if p0type != int32(SQLITE_BLOB) { for *(*uint8)(unsafe.Pointer(z)) != 0 && p1 != 0 { @@ -102700,10 +103403,13 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } Xsqlite3_result_text64(tls, context, z, libc.Uint64FromInt64(int64(z2)-int64(z)), uintptr(-libc.Int32FromInt32(1)), uint8(SQLITE_UTF8)) } else { - if p1+p2 > int64(len1) { - p2 = int64(len1) - p1 - if p2 < 0 { - p2 = 0 + if p1 >= int64(len1) { + v6 = libc.Int64FromInt32(0) + p2 = v6 + p1 = v6 + } else { + if p2 > int64(len1)-p1 { + p2 = int64(len1) - p1 } } Xsqlite3_result_blob64(tls, context, z+uintptr(p1), libc.Uint64FromInt64(p2), uintptr(-libc.Int32FromInt32(1))) @@ -102718,7 +103424,7 @@ func _substrFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { func _roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - var n int32 + var n Ti64 var zBuf uintptr var v1 float64 var _ /* r at bp+0 */ float64 @@ -102728,9 +103434,9 @@ func _roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if int32(SQLITE_NULL) == Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) { return } - n = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) - if n > int32(30) { - n = int32(30) + n = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if n > int64(30) { + n = int64(30) } if n < 0 { n = 0 @@ -102755,7 +103461,7 @@ func _roundFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } *(*float64)(unsafe.Pointer(bp)) = float64(int64(*(*float64)(unsafe.Pointer(bp)) + v1)) } else { - zBuf = Xsqlite3_mprintf(tls, __ccgo_ts+15332, libc.VaList(bp+16, n, *(*float64)(unsafe.Pointer(bp)))) + zBuf = Xsqlite3_mprintf(tls, __ccgo_ts+15394, libc.VaList(bp+16, int32(n), *(*float64)(unsafe.Pointer(bp)))) if zBuf == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -103335,7 +104041,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { */ nPat = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) if nPat > *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15338, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15400, -int32(1)) return } if argc == int32(3) { @@ -103347,7 +104053,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15371, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15433, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -103429,7 +104135,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -103516,17 +104222,17 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15416, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15478, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15424, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15486, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1423, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1424, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) case int32(SQLITE_BLOB): zBlob = Xsqlite3_value_blob(tls, pValue) nBlob = int64(Xsqlite3_value_bytes(tls, pValue)) @@ -103554,9 +104260,9 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15432, libc.VaList(bp+16, zArg)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15494, libc.VaList(bp+16, zArg)) default: - Xsqlite3_str_append(tls, pStr, __ccgo_ts+1663, int32(4)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+1664, int32(4)) break } } @@ -103793,7 +104499,7 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { var v3 uint32 var _ /* zHex at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, ch, d, nHex, nPass, p, pBlob, zPass, v1, v2, v3, v4, v5, v6 - zPass = __ccgo_ts + 1662 + zPass = __ccgo_ts + 1663 nPass = 0 *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -104106,7 +104812,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11327, + 0: __ccgo_ts + 11389, } // C documentation @@ -104174,7 +104880,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n // ** concatentation of all non-null arguments. // */ func _concatFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1662) + _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1663) } // C documentation @@ -104220,7 +104926,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _, _, _, _, _, _, _ = code, i, j, prevcode, zIn, v3, v4 zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn == uintptr(0) { - zIn = __ccgo_ts + 1662 + zIn = __ccgo_ts + 1663 } i = 0 for { @@ -104266,7 +104972,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, __ccgo_ts+15435, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15497, int32(4), libc.UintptrFromInt32(0)) } } @@ -104327,7 +105033,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12545, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12607, -int32(1)) return } if argc == int32(2) { @@ -104492,7 +105198,10 @@ func _sumInverse(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if p != 0 && type1 != int32(SQLITE_NULL) { (*TSumCtx)(unsafe.Pointer(p)).Fcnt-- if !((*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0) { - *(*Ti64)(unsafe.Pointer(p + 16)) -= Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _sqlite3SubInt64(tls, p+16, Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv)))) != 0 { + (*TSumCtx)(unsafe.Pointer(p)).Fovrfl = uint8(1) + (*TSumCtx)(unsafe.Pointer(p)).Fapprox = uint8(1) + } } else { if type1 == int32(SQLITE_INTEGER) { iVal = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -104516,7 +105225,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15315, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15377, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -104698,7 +105407,11 @@ func _minMaxFinalize(tls *libc.TLS, context uintptr) { // ** group_concat(EXPR, ?SEPARATOR?) // ** string_agg(EXPR, SEPARATOR) // ** -// ** The SEPARATOR goes before the EXPR string. This is tragic. The +// ** Content is accumulated in GroupConcatCtx.str with the SEPARATOR +// ** coming before the EXPR value, except for the first entry which +// ** omits the SEPARATOR. +// ** +// ** It is tragic that the SEPARATOR goes before the EXPR string. The // ** groupConcatInverse() implementation would have been easier if the // ** SEPARATOR were appended after EXPR. And the order is undocumented, // ** so we could change it, in theory. But the old behavior has been @@ -104790,7 +105503,7 @@ func _groupConcatInverse(tls *libc.TLS, context uintptr, argc int32, argv uintpt pGCC = Xsqlite3_aggregate_context(tls, context, int32(48)) /* pGCC is always non-NULL since groupConcatStep() will have always ** run first to initialize it */ - if pGCC != 0 { + if pGCC != 0 { /* Number of characters to remove */ /* Must call sqlite3_value_text() to convert the argument into text prior ** to invoking sqlite3_value_bytes(), in case the text encoding is UTF16 */ Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -104842,7 +105555,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { Xsqlite3_result_error_nomem(tls, context) } else { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 && (*TStrAccum)(unsafe.Pointer(pAccum)).FnChar == uint32(0) { - Xsqlite3_result_text(tls, context, __ccgo_ts+1662, int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+1663, int32(1), libc.UintptrFromInt32(0)) } else { zText = Xsqlite3_str_value(tls, pAccum) Xsqlite3_result_text(tls, context, zText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) @@ -104862,7 +105575,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15440, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15502, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -104891,8 +105604,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15446, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15446, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15508, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15508, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -105180,7 +105893,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7920)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) } /* @@ -105193,567 +105906,542 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [110]TFuncDef{ +var _aBuiltinFunc = [104]TFuncDef{ 0: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15451, + FzName: __ccgo_ts + 15513, }, 1: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15471, + FzName: __ccgo_ts + 15533, }, 2: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15484, + FzName: __ccgo_ts + 15546, }, 3: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15502, + FzName: __ccgo_ts + 15564, }, 4: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15511, + FzName: __ccgo_ts + 15573, }, 5: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15519, + FzName: __ccgo_ts + 15581, }, 6: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15519, + FzName: __ccgo_ts + 15581, }, 7: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15534, + FzName: __ccgo_ts + 15596, }, 8: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15560, + FzName: __ccgo_ts + 15622, }, 9: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15585, + FzName: __ccgo_ts + 15647, }, 10: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15594, + FzName: __ccgo_ts + 15656, }, 11: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15605, + FzName: __ccgo_ts + 15667, }, 12: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 15612, + FzName: __ccgo_ts + 15674, }, 13: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15626, + FzName: __ccgo_ts + 15688, }, 14: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15626, + FzName: __ccgo_ts + 15688, }, 15: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15632, + FzName: __ccgo_ts + 15694, }, 16: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15632, + FzName: __ccgo_ts + 15694, }, 17: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15638, + FzName: __ccgo_ts + 15700, }, 18: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15638, + FzName: __ccgo_ts + 15700, }, 19: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15643, + FzName: __ccgo_ts + 15705, }, 20: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15643, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), + FzName: __ccgo_ts + 15705, }, 21: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15643, + FnArg: int16(-int32(3)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 15709, }, 22: { - FnArg: int8(-int32(1)), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15647, + FzName: __ccgo_ts + 15709, }, 23: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15647, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), + FzName: __ccgo_ts + 15713, }, 24: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15647, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), + FzName: __ccgo_ts + 15720, }, 25: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15651, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), + FzName: __ccgo_ts + 15728, }, 26: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15658, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), + FzName: __ccgo_ts + 15735, }, 27: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15666, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15748, }, 28: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15673, + FnArg: int16(-int32(1)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15754, }, 29: { - FnArg: int8(2), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15686, + FzName: __ccgo_ts + 15761, }, 30: { - FnArg: int8(-int32(1)), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15692, + FzName: __ccgo_ts + 15768, }, 31: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15699, + FzName: __ccgo_ts + 15776, }, 32: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15706, + FzName: __ccgo_ts + 15781, }, 33: { - FnArg: int8(-int32(1)), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15714, + FzName: __ccgo_ts + 15785, }, 34: { - FnArg: int8(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15719, + FzName: __ccgo_ts + 15785, }, 35: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15723, + FzName: __ccgo_ts + 15791, }, 36: { - FnArg: int8(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15723, + FzName: __ccgo_ts + 15797, }, 37: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15729, + FzName: __ccgo_ts + 15803, }, 38: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15735, + FzName: __ccgo_ts + 15807, }, 39: { - FnArg: int8(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15741, + FzName: __ccgo_ts + 15807, }, 40: { - FnArg: int8(1), + FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15745, + FzName: __ccgo_ts + 15813, }, 41: { - FnArg: int8(2), + FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15745, + FzName: __ccgo_ts + 15820, }, 42: { - FnArg: int8(-int32(1)), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15751, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), + FzName: __ccgo_ts + 15830, }, 43: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15751, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15837, }, 44: { - FnArg: int8(-int32(1)), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15758, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15844, }, 45: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15758, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15855, }, 46: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15758, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 15862, }, 47: { - FnArg: int8(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15768, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 15877, }, 48: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15775, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15894, }, 49: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15782, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15905, }, 50: { - FnArg: int8(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15793, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15911, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15800, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15929, }, 52: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15815, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15937, }, 53: { - FnArg: int8(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15832, + FzName: __ccgo_ts + 15951, }, 54: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15843, + FzName: __ccgo_ts + 15959, }, 55: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15849, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15968, }, 56: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15867, + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15968, }, 57: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15875, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15975, }, 58: { - FnArg: int8(3), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15889, + FzName: __ccgo_ts + 15975, }, 59: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15897, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), + FzName: __ccgo_ts + 15985, }, 60: { - FnArg: int8(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15906, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), + FzName: __ccgo_ts + 15989, }, 61: { - FnArg: int8(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15906, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), + FzName: __ccgo_ts + 15995, }, 62: { - FnArg: int8(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15913, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), + FzName: __ccgo_ts + 15999, }, 63: { - FnArg: int8(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15913, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), + FzName: __ccgo_ts + 15999, }, 64: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15923, + FzName: __ccgo_ts + 16005, }, 65: { - FnArg: int8(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15927, + FzName: __ccgo_ts + 16005, }, 66: { - FnArg: int8(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15933, + FzName: __ccgo_ts + 16018, }, 67: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15937, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), + FpUserData: uintptr(unsafe.Pointer(&_globInfo)), + FzName: __ccgo_ts + 16029, }, 68: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15937, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), + FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), + FzName: __ccgo_ts + 15508, }, 69: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15943, + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), + FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), + FzName: __ccgo_ts + 15508, }, 70: { - FnArg: int8(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15943, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16034, }, 71: { - FnArg: int8(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15956, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1236, }, 72: { - FnArg: int8(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), - FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 15967, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1244, }, 73: { - FnArg: int8(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), - FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15446, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16039, }, 74: { - FnArg: int8(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), - FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15446, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16045, }, 75: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 6794, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16048, }, 76: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 6794, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16052, }, 77: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15972, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(2))), + FzName: __ccgo_ts + 16058, }, 78: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1235, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16048, }, 79: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1243, + FzName: __ccgo_ts + 16063, }, 80: { - FnArg: int8(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15977, + FzName: __ccgo_ts + 16067, }, 81: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15983, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16071, }, 82: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15986, + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16077, }, 83: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15990, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16081, }, 84: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15996, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16086, }, 85: { - FnArg: int8(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15986, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16091, }, 86: { - FnArg: int8(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16001, + FzName: __ccgo_ts + 16096, }, 87: { - FnArg: int8(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16005, + FzName: __ccgo_ts + 16102, }, 88: { - FnArg: int8(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16009, + FzName: __ccgo_ts + 16106, }, 89: { - FnArg: int8(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16015, + FzName: __ccgo_ts + 16110, }, 90: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16019, + FzName: __ccgo_ts + 16114, }, 91: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16024, + FzName: __ccgo_ts + 16119, }, 92: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16029, + FzName: __ccgo_ts + 16124, }, 93: { - FnArg: int8(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16034, + FzName: __ccgo_ts + 16129, }, 94: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16040, + FzName: __ccgo_ts + 16135, }, 95: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16044, + FzName: __ccgo_ts + 16141, }, 96: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16048, + FzName: __ccgo_ts + 16147, }, 97: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16052, + FzName: __ccgo_ts + 16152, }, 98: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16057, + FzName: __ccgo_ts + 16160, }, 99: { - FnArg: int8(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16062, + FzName: __ccgo_ts + 16168, }, 100: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16067, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16171, }, 101: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16073, + FnArg: int16(-int32(4)), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), + FzName: __ccgo_ts + 6856, }, 102: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16079, - }, - 103: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16085, - }, - 104: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, - }, - 105: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16098, - }, - 106: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16106, - }, - 107: { - FnArg: int8(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16109, - }, - 108: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6794, + FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), + FzName: __ccgo_ts + 16176, }, - 109: { - FnArg: int8(3), + 103: { + FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16114, + FzName: __ccgo_ts + 16180, }, } @@ -105779,141 +106467,142 @@ func init() { *(*uintptr)(unsafe.Add(p, 1248)) = __ccgo_fp(_trimFunc) *(*uintptr)(unsafe.Add(p, 1320)) = __ccgo_fp(_trimFunc) *(*uintptr)(unsafe.Add(p, 1392)) = __ccgo_fp(_minmaxFunc) - *(*uintptr)(unsafe.Add(p, 1536)) = __ccgo_fp(_minmaxStep) - *(*uintptr)(unsafe.Add(p, 1544)) = __ccgo_fp(_minMaxFinalize) - *(*uintptr)(unsafe.Add(p, 1552)) = __ccgo_fp(_minMaxValue) - *(*uintptr)(unsafe.Add(p, 1608)) = __ccgo_fp(_minmaxFunc) - *(*uintptr)(unsafe.Add(p, 1752)) = __ccgo_fp(_minmaxStep) - *(*uintptr)(unsafe.Add(p, 1760)) = __ccgo_fp(_minMaxFinalize) - *(*uintptr)(unsafe.Add(p, 1768)) = __ccgo_fp(_minMaxValue) - *(*uintptr)(unsafe.Add(p, 1824)) = __ccgo_fp(_typeofFunc) - *(*uintptr)(unsafe.Add(p, 1896)) = __ccgo_fp(_subtypeFunc) - *(*uintptr)(unsafe.Add(p, 1968)) = __ccgo_fp(_lengthFunc) - *(*uintptr)(unsafe.Add(p, 2040)) = __ccgo_fp(_bytelengthFunc) - *(*uintptr)(unsafe.Add(p, 2112)) = __ccgo_fp(_instrFunc) - *(*uintptr)(unsafe.Add(p, 2184)) = __ccgo_fp(_printfFunc) - *(*uintptr)(unsafe.Add(p, 2256)) = __ccgo_fp(_printfFunc) - *(*uintptr)(unsafe.Add(p, 2328)) = __ccgo_fp(_unicodeFunc) - *(*uintptr)(unsafe.Add(p, 2400)) = __ccgo_fp(_charFunc) - *(*uintptr)(unsafe.Add(p, 2472)) = __ccgo_fp(_absFunc) - *(*uintptr)(unsafe.Add(p, 2544)) = __ccgo_fp(_roundFunc) - *(*uintptr)(unsafe.Add(p, 2616)) = __ccgo_fp(_roundFunc) - *(*uintptr)(unsafe.Add(p, 2688)) = __ccgo_fp(_upperFunc) - *(*uintptr)(unsafe.Add(p, 2760)) = __ccgo_fp(_lowerFunc) - *(*uintptr)(unsafe.Add(p, 2832)) = __ccgo_fp(_hexFunc) - *(*uintptr)(unsafe.Add(p, 2904)) = __ccgo_fp(_unhexFunc) - *(*uintptr)(unsafe.Add(p, 2976)) = __ccgo_fp(_unhexFunc) - *(*uintptr)(unsafe.Add(p, 3048)) = __ccgo_fp(_concatFunc) - *(*uintptr)(unsafe.Add(p, 3192)) = __ccgo_fp(_concatwsFunc) - *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_randomFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_randomBlob) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_nullifFunc) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_sourceidFunc) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 5000)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 5008)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 5016)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 5072)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 5080)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 5088)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 5144)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 5152)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 5160)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5552)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5624)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(_xFloor) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xtrunc) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xfmod) - *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xacos) + *(*uintptr)(unsafe.Add(p, 1464)) = __ccgo_fp(_minmaxStep) + *(*uintptr)(unsafe.Add(p, 1472)) = __ccgo_fp(_minMaxFinalize) + *(*uintptr)(unsafe.Add(p, 1480)) = __ccgo_fp(_minMaxValue) + *(*uintptr)(unsafe.Add(p, 1536)) = __ccgo_fp(_minmaxFunc) + *(*uintptr)(unsafe.Add(p, 1608)) = __ccgo_fp(_minmaxStep) + *(*uintptr)(unsafe.Add(p, 1616)) = __ccgo_fp(_minMaxFinalize) + *(*uintptr)(unsafe.Add(p, 1624)) = __ccgo_fp(_minMaxValue) + *(*uintptr)(unsafe.Add(p, 1680)) = __ccgo_fp(_typeofFunc) + *(*uintptr)(unsafe.Add(p, 1752)) = __ccgo_fp(_subtypeFunc) + *(*uintptr)(unsafe.Add(p, 1824)) = __ccgo_fp(_lengthFunc) + *(*uintptr)(unsafe.Add(p, 1896)) = __ccgo_fp(_bytelengthFunc) + *(*uintptr)(unsafe.Add(p, 1968)) = __ccgo_fp(_instrFunc) + *(*uintptr)(unsafe.Add(p, 2040)) = __ccgo_fp(_printfFunc) + *(*uintptr)(unsafe.Add(p, 2112)) = __ccgo_fp(_printfFunc) + *(*uintptr)(unsafe.Add(p, 2184)) = __ccgo_fp(_unicodeFunc) + *(*uintptr)(unsafe.Add(p, 2256)) = __ccgo_fp(_charFunc) + *(*uintptr)(unsafe.Add(p, 2328)) = __ccgo_fp(_absFunc) + *(*uintptr)(unsafe.Add(p, 2400)) = __ccgo_fp(_roundFunc) + *(*uintptr)(unsafe.Add(p, 2472)) = __ccgo_fp(_roundFunc) + *(*uintptr)(unsafe.Add(p, 2544)) = __ccgo_fp(_upperFunc) + *(*uintptr)(unsafe.Add(p, 2616)) = __ccgo_fp(_lowerFunc) + *(*uintptr)(unsafe.Add(p, 2688)) = __ccgo_fp(_hexFunc) + *(*uintptr)(unsafe.Add(p, 2760)) = __ccgo_fp(_unhexFunc) + *(*uintptr)(unsafe.Add(p, 2832)) = __ccgo_fp(_unhexFunc) + *(*uintptr)(unsafe.Add(p, 2904)) = __ccgo_fp(_concatFunc) + *(*uintptr)(unsafe.Add(p, 2976)) = __ccgo_fp(_concatwsFunc) + *(*uintptr)(unsafe.Add(p, 3048)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 3120)) = __ccgo_fp(_randomFunc) + *(*uintptr)(unsafe.Add(p, 3192)) = __ccgo_fp(_randomBlob) + *(*uintptr)(unsafe.Add(p, 3264)) = __ccgo_fp(_nullifFunc) + *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) + *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xsin) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(libc.Xtanh) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(libc.Xacosh) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7280)) = __ccgo_fp(libc.Xasinh) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7352)) = __ccgo_fp(libc.Xatanh) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7424)) = __ccgo_fp(libc.Xsqrt) - *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7496)) = __ccgo_fp(_degToRad) - *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7568)) = __ccgo_fp(_radToDeg) - *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7656)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7728)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7800)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7872)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -106230,7 +106919,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16118, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16183, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -107051,10 +107740,10 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, pSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if pSrc != 0 { pItem = pSrc + 8 - (*TSrcItem)(unsafe.Pointer(pItem)).FpTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom + (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName - (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FnTabRef++ - v7 = pParse + 52 + (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ + v7 = pParse + 56 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -107341,11 +108030,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6660, + Fz: __ccgo_ts + 6722, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6656, + Fz: __ccgo_ts + 6718, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -107409,14 +108098,15 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_RAISE), __ccgo_ts+5289) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5306) + pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = uint8(OE_Abort) } pSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) if pSrc != 0 { (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = _sqlite3DbStrDup(tls, db, zFrom) - (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzDatabase = _sqlite3DbStrDup(tls, db, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + *(*uintptr)(unsafe.Pointer(pSrc + 8 + 72)) = _sqlite3DbStrDup(tls, db, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) } pSelect = _sqlite3SelectNew(tls, pParse, _sqlite3ExprListAppend(tls, pParse, uintptr(0), pRaise), pSrc, pWhere, uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) pWhere = uintptr(0) @@ -107990,7 +108680,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8287, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8349, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -108056,11 +108746,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 56 + v3 = pToplevel + 60 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 56)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -108263,8 +108953,10 @@ func _sqlite3MultiValuesEnd(tls *libc.TLS, pParse uintptr, pVal uintptr) { _ = pItem if pVal != 0 && (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pVal)).FpSrc)).FnSrc > 0 { pItem = (*TSelect)(unsafe.Pointer(pVal)).FpSrc + 8 - _sqlite3VdbeEndCoroutine(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, (*TSrcItem)(unsafe.Pointer(pItem)).FregReturn) - _sqlite3VdbeJumpHere(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, (*TSrcItem)(unsafe.Pointer(pItem)).FaddrFillSub-int32(1)) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { + _sqlite3VdbeEndCoroutine(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FregReturn) + _sqlite3VdbeJumpHere(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FaddrFillSub-int32(1)) + } } } @@ -108380,9 +109072,9 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint bp := tls.Alloc(48) defer tls.Free(48) var f, v1 int32 - var p, pRet, pSelect, v, v2 uintptr + var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest - _, _, _, _, _, _, _ = f, p, pRet, pSelect, v, v1, v2 + _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) @@ -108426,28 +109118,30 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint (*TSelect)(unsafe.Pointer(pLeft)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pLeft)).Fop = uint8(TK_SELECT) p = (*TSelect)(unsafe.Pointer(pRet)).FpSrc + 8 - (*TSrcItem)(unsafe.Pointer(p)).FpSelect = pLeft - libc.SetBitFieldPtr16Uint32(p+60+4, libc.Uint32FromInt32(1), 5, 0x20) - (*TSrcItem)(unsafe.Pointer(p)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 56 - *(*int32)(unsafe.Pointer(v2))++ - v1 = *(*int32)(unsafe.Pointer(v2)) - (*TSrcItem)(unsafe.Pointer(p)).FregReturn = v1 + libc.SetBitFieldPtr32Uint32(p+24+4, libc.Uint32FromInt32(1), 6, 0x40) (*TSrcItem)(unsafe.Pointer(p)).FiCursor = -int32(1) *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(p)).Fu1)) = uint32(2) - _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSrcItem)(unsafe.Pointer(p)).FregReturn, 0, (*TSrcItem)(unsafe.Pointer(p)).FaddrFillSub) - _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), (*TSrcItem)(unsafe.Pointer(p)).FregReturn) - /* Allocate registers for the output of the co-routine. Do so so - ** that there are two unused registers immediately before those - ** used by the co-routine. This allows the code in sqlite3Insert() - ** to use these registers directly, instead of copying the output - ** of the co-routine to a separate array for processing. */ - (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) - (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst - *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) - _sqlite3Select(tls, pParse, pLeft, bp) - (*TSrcItem)(unsafe.Pointer(p)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst + if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { + pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) + (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) + v2 = pParse + 60 + *(*int32)(unsafe.Pointer(v2))++ + v1 = *(*int32)(unsafe.Pointer(v2)) + (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 + _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub) + _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) + /* Allocate registers for the output of the co-routine. Do so so + ** that there are two unused registers immediately before those + ** used by the co-routine. This allows the code in sqlite3Insert() + ** to use these registers directly, instead of copying the output + ** of the co-routine to a separate array for processing. */ + (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) + _sqlite3Select(tls, pParse, pLeft, bp) + (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst + } pLeft = pRet } } else { @@ -108455,11 +109149,12 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(p)).Fu1))++ } if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p)).FpSelect)).FpEList)).FnExpr != (*TExprList)(unsafe.Pointer(pRow)).FnExpr { - _sqlite3SelectWrongNumTermsError(tls, pParse, (*TSrcItem)(unsafe.Pointer(p)).FpSelect) + pSubq1 = *(*uintptr)(unsafe.Pointer(p + 72)) + if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq1)).FpSelect)).FpEList)).FnExpr != (*TExprList)(unsafe.Pointer(pRow)).FnExpr { + _sqlite3SelectWrongNumTermsError(tls, pParse, (*TSubquery)(unsafe.Pointer(pSubq1)).FpSelect) } else { - _sqlite3ExprCodeExprList(tls, pParse, pRow, (*TSrcItem)(unsafe.Pointer(p)).FregResult, 0, uint8(0)) - _sqlite3VdbeAddOp1(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Yield), (*TSrcItem)(unsafe.Pointer(p)).FregReturn) + _sqlite3ExprCodeExprList(tls, pParse, pRow, (*TSubquery)(unsafe.Pointer(pSubq1)).FregResult, 0, uint8(0)) + _sqlite3VdbeAddOp1(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Yield), (*TSubquery)(unsafe.Pointer(pSubq1)).FregReturn) } } _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pRow) @@ -108569,32 +109264,33 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, db, pIdx, pIpk, pItem, pList, pNx, pTab, pTrigger, pVTab, pX, v, v10, v14, v17, v19, v7 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v13, v16, v18, v20, v24, v25, v5, v6, v8, v9 int32 - var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 - var colFlags, v22 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 + var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 + var colFlags, v21 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v10, v13, v14, v16, v17, v18, v19, v20, v22, v24, v25, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ - regFromSelect = 0 /* Base register for data coming from SELECT */ - regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ - regRowCount = 0 /* register holding first column to insert */ - aRegIdx = uintptr(0) /* Mask of trigger times */ + regFromSelect = 0 /* Base register for data coming from SELECT */ + regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ + regRowCount = 0 /* register holding first column to insert */ + aRegIdx = uintptr(0) /* One register allocated to each index */ + aTabColMap = uintptr(0) /* Mask of trigger times */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto insert_cleanup @@ -108669,7 +109365,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -108696,30 +109392,29 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - (*TIdList)(unsafe.Pointer(pColumn)).FeU4 = uint8(EU4_IDX) - i = 0 - for { - if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { - break - } - *(*int32)(unsafe.Pointer(pColumn + 8 + uintptr(i)*16 + 8)) = -int32(1) - goto _2 - _2: - ; - i++ + aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + if aTabColMap == uintptr(0) { + goto insert_cleanup } i = 0 for { if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } + zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName + hName = _sqlite3StrIHash(tls, zCName) j = 0 for { if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - if _sqlite3StrICmp(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*16))).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - *(*int32)(unsafe.Pointer(pColumn + 8 + uintptr(i)*16 + 8)) = j + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { + goto _3 + } + if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) + } if i != j { bIdListInOrder = uint8(0) } @@ -108727,28 +109422,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ipkColumn = i } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16163, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16228, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) goto insert_cleanup } break } - goto _4 - _4: + goto _3 + _3: ; j++ } if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*16))).FzName) != 0 && !(withoutRowid != 0) { + if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16204, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*16))).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16269, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) goto insert_cleanup } } - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -108759,36 +109454,37 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** co-routine is the common header to the 3rd and 4th templates. */ if pSelect != 0 { /* Result code */ - if (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpSrc)).FnSrc == int32(1) && int32(uint32(*(*uint16)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpSrc + 8 + 60 + 4))&0x20>>5)) != 0 && (*TSelect)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0) { + if (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpSrc)).FnSrc == int32(1) && int32(*(*uint32)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpSrc + 8 + 24 + 4))&0x40>>6) != 0 && (*TSelect)(unsafe.Pointer(pSelect)).FpPrior == uintptr(0) { pItem = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc + 8 - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSrcItem)(unsafe.Pointer(pItem)).FregReturn - regFromSelect = (*TSrcItem)(unsafe.Pointer(pItem)).FregResult - nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16236, libc.VaList(bp+128, pItem)) + pSubq = *(*uintptr)(unsafe.Pointer(pItem + 72)) + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn + regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult + nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16301, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v5 = int32(1) + v4 = int32(1) } else { - v5 = 0 + v4 = 0 } - regIns = regRowid - v5 + regIns = regRowid - v4 } } else { - v7 = pParse + 56 - *(*int32)(unsafe.Pointer(v7))++ - v6 = *(*int32)(unsafe.Pointer(v7)) /* Top of the co-routine */ - regYield = v6 + v6 = pParse + 60 + *(*int32)(unsafe.Pointer(v6))++ + v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ + regYield = v5 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v8 = regData + v7 = regData } else { - v8 = 0 + v7 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v8 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -108812,10 +109508,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v10 = pParse + 52 - v9 = *(*int32)(unsafe.Pointer(v10)) - *(*int32)(unsafe.Pointer(v10))++ - srcTab = v9 + v9 = pParse + 56 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + srcTab = v8 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -108856,8 +109552,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _11 - _11: + goto _10 + _10: ; i-- } @@ -108874,28 +109570,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _12 - _12: + goto _11 + _11: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16244, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16309, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16296, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16361, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { - v14 = pParse + 56 - *(*int32)(unsafe.Pointer(v14))++ - v13 = *(*int32)(unsafe.Pointer(v14)) - regRowCount = v13 + v13 = pParse + 60 + *(*int32)(unsafe.Pointer(v13))++ + v12 = *(*int32)(unsafe.Pointer(v13)) + regRowCount = v12 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regRowCount) } /* If this is not a view, open the table and and all indices */ @@ -108911,29 +109607,29 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < nIdx) { break } - v17 = pParse + 56 - *(*int32)(unsafe.Pointer(v17))++ - v16 = *(*int32)(unsafe.Pointer(v17)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = v16 - *(*int32)(unsafe.Pointer(pParse + 56)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) - goto _15 - _15: + v16 = pParse + 60 + *(*int32)(unsafe.Pointer(v16))++ + v15 = *(*int32)(unsafe.Pointer(v16)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = v15 + *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + goto _14 + _14: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext i++ } - v19 = pParse + 56 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = v18 /* Register to store the table record */ + v18 = pParse + 60 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(i)*4)) = v17 /* Register to store the table record */ } if pUpsert != 0 { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16321, libc.VaList(bp+128, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16386, libc.VaList(bp+128, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto insert_cleanup } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16367, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16432, 0) goto insert_cleanup } if _sqlite3HasExplicitNulls(tls, pParse, (*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget) != 0 { @@ -108977,9 +109673,9 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** goto C ** D: ... */ - v20 = _sqlite3VdbeAddOp1(tls, v, int32(OP_Yield), (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm) - addrCont = v20 - addrInsTop = v20 + v19 = _sqlite3VdbeAddOp1(tls, v, int32(OP_Yield), (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm) + addrCont = v19 + addrInsTop = v19 if ipkColumn >= 0 { /* 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 @@ -109008,18 +109704,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _21 + goto _20 } - v22 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v22 - if v22&uint32(COLFLAG_NOINSERT) != uint32(0) { + v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v21 + if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* 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 _21 + goto _20 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -109029,40 +109725,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _21 + goto _20 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT ** get there default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _21 + goto _20 } } } } if pColumn != 0 { - j = 0 - for { - if !(j < (*TIdList)(unsafe.Pointer(pColumn)).FnId && *(*int32)(unsafe.Pointer(pColumn + 8 + uintptr(j)*16 + 8)) != i) { - break - } - goto _23 - _23: - ; - j++ - } - if j >= (*TIdList)(unsafe.Pointer(pColumn)).FnId { + j = *(*int32)(unsafe.Pointer(aTabColMap + uintptr(i)*4)) + if j == 0 { /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _21 + goto _20 } - k = j + k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _21 + goto _20 } else { k = i - nHidden } @@ -109079,16 +109766,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v24 = int32(OP_Copy) + v22 = int32(OP_Copy) } else { - v24 = int32(OP_SCopy) + v22 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v24, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) } } } - goto _21 - _21: + goto _20 + _20: ; i++ iRegStore++ @@ -109199,11 +109886,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v25 = int32(OE_Abort) + v23 = int32(OE_Abort) } else { - v25 = onError + v23 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v25)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -109262,7 +109949,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16388) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16453) } goto insert_cleanup insert_cleanup: @@ -109271,7 +109958,10 @@ insert_cleanup: _sqlite3ExprListDelete(tls, db, pList) _sqlite3UpsertDelete(tls, db, pUpsert) _sqlite3SelectDelete(tls, db, pSelect) - _sqlite3IdListDelete(tls, db, pColumn) + if pColumn != 0 { + _sqlite3IdListDelete(tls, db, pColumn) + _sqlite3DbFree(tls, db, aTabColMap) + } if aRegIdx != 0 { _sqlite3DbNNFreeNN(tls, db, aRegIdx) } @@ -109655,7 +110345,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12506, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<<libc.Int32FromInt32(8), onError, iReg) _sqlite3VdbeAppendP4(tls, v, zMsg, -int32(6)) _sqlite3VdbeChangeP5(tls, v, uint16(P5_ConstraintNotNull)) @@ -109890,7 +110580,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt if regTrigCnt != 0 { /* Replace triggers might exist. Allocate the counter and ** initialize it to zero. */ - v8 = pParse + 56 + v8 = pParse + 60 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regTrigCnt = v7 @@ -110610,7 +111300,7 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin if (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpSrc)).FnSrc != int32(1) { return 0 /* FROM clause must have exactly one term */ } - if (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpSrc + 8))).FpSelect != 0 { + if int32(*(*uint32)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpSrc + 8 + 24 + 4))&0x4>>2) != 0 { return 0 /* FROM clause cannot contain a subquery */ } if (*TSelect)(unsafe.Pointer(pSelect)).FpWhere != 0 { @@ -110787,11 +111477,11 @@ func _xferOptimization(tls *libc.TLS, pParse uintptr, pDest uintptr, pSelect uin iDbSrc = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pSrc)).FpSchema) v = _sqlite3GetVdbe(tls, pParse) _sqlite3CodeVerifySchema(tls, pParse, iDbSrc) - v5 = pParse + 52 + v5 = pParse + 56 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSrc = v4 - v7 = pParse + 52 + v7 = pParse + 56 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDest = v6 @@ -111007,10 +111697,10 @@ func Xsqlite3_exec(tls *libc.TLS, db uintptr, zSql uintptr, xCallback Tsqlite3_c *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* The current SQL statement */ azCols = uintptr(0) /* True if callback data is initialized */ if !(_sqlite3SafetyCheckOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(136313)) + return _sqlite3MisuseError(tls, int32(137270)) } if zSql == uintptr(0) { - zSql = __ccgo_ts + 1662 + zSql = __ccgo_ts + 1663 } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3Error(tls, db, SQLITE_OK) @@ -111810,14 +112500,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtension) == uint64(0) { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+12545, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+12607, 0) } return int32(SQLITE_ERROR) } if zProc != 0 { v1 = zProc } else { - v1 = __ccgo_ts + 16405 + v1 = __ccgo_ts + 16470 } zEntry = v1 /* tag-20210611-1. Some dlopen() implementations will segfault if given @@ -111842,7 +112532,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) && handle == uintptr(0)) { break } - zAltFile = Xsqlite3_mprintf(tls, __ccgo_ts+12506, libc.VaList(bp+16, zFile, _azEndings[ii])) + zAltFile = Xsqlite3_mprintf(tls, __ccgo_ts+12568, libc.VaList(bp+16, zFile, _azEndings[ii])) if zAltFile == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -111877,7 +112567,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_NOMEM) } - libc.Xmemcpy(tls, zAltEntry, __ccgo_ts+16428, uint64(8)) + libc.Xmemcpy(tls, zAltEntry, __ccgo_ts+16493, uint64(8)) iFile = ncFile - int32(1) for { if !(iFile >= 0 && !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -111889,7 +112579,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16437, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16502, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -111909,7 +112599,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16441, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16506, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -111921,7 +112611,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16447, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16512, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -111936,7 +112626,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16490, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16555, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) @@ -111967,7 +112657,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16522, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16587, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -111976,7 +112666,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16402, + 0: __ccgo_ts + 16467, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -112209,7 +112899,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16559, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16624, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -112263,63 +112953,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5545, - 1: __ccgo_ts + 16598, - 2: __ccgo_ts + 9183, - 3: __ccgo_ts + 16602, - 4: __ccgo_ts + 16607, - 5: __ccgo_ts + 16610, - 6: __ccgo_ts + 16620, - 7: __ccgo_ts + 16630, - 8: __ccgo_ts + 16636, - 9: __ccgo_ts + 16640, - 10: __ccgo_ts + 16645, - 11: __ccgo_ts + 16650, - 12: __ccgo_ts + 16658, - 13: __ccgo_ts + 16669, - 14: __ccgo_ts + 16672, - 15: __ccgo_ts + 16679, - 16: __ccgo_ts + 16640, - 17: __ccgo_ts + 16645, - 18: __ccgo_ts + 16686, - 19: __ccgo_ts + 16691, - 20: __ccgo_ts + 16694, - 21: __ccgo_ts + 16701, - 22: __ccgo_ts + 16636, - 23: __ccgo_ts + 16640, - 24: __ccgo_ts + 16707, - 25: __ccgo_ts + 16712, - 26: __ccgo_ts + 16717, - 27: __ccgo_ts + 16640, - 28: __ccgo_ts + 16721, - 29: __ccgo_ts + 16645, - 30: __ccgo_ts + 16729, - 31: __ccgo_ts + 16733, - 32: __ccgo_ts + 16738, - 33: __ccgo_ts + 11922, - 34: __ccgo_ts + 11918, - 35: __ccgo_ts + 16744, - 36: __ccgo_ts + 16749, - 37: __ccgo_ts + 16754, - 38: __ccgo_ts + 16598, - 39: __ccgo_ts + 16640, - 40: __ccgo_ts + 16759, - 41: __ccgo_ts + 16766, - 42: __ccgo_ts + 16773, - 43: __ccgo_ts + 9183, - 44: __ccgo_ts + 16781, - 45: __ccgo_ts + 5548, - 46: __ccgo_ts + 16787, - 47: __ccgo_ts + 16598, - 48: __ccgo_ts + 16640, - 49: __ccgo_ts + 16792, - 50: __ccgo_ts + 16797, - 51: __ccgo_ts + 15986, - 52: __ccgo_ts + 16802, - 53: __ccgo_ts + 16815, - 54: __ccgo_ts + 16824, - 55: __ccgo_ts + 16831, - 56: __ccgo_ts + 16842, + 0: __ccgo_ts + 5562, + 1: __ccgo_ts + 16663, + 2: __ccgo_ts + 9245, + 3: __ccgo_ts + 16667, + 4: __ccgo_ts + 16672, + 5: __ccgo_ts + 16675, + 6: __ccgo_ts + 16685, + 7: __ccgo_ts + 16695, + 8: __ccgo_ts + 16701, + 9: __ccgo_ts + 16705, + 10: __ccgo_ts + 16710, + 11: __ccgo_ts + 16715, + 12: __ccgo_ts + 16723, + 13: __ccgo_ts + 16734, + 14: __ccgo_ts + 16737, + 15: __ccgo_ts + 16744, + 16: __ccgo_ts + 16705, + 17: __ccgo_ts + 16710, + 18: __ccgo_ts + 16751, + 19: __ccgo_ts + 16756, + 20: __ccgo_ts + 16759, + 21: __ccgo_ts + 16766, + 22: __ccgo_ts + 16701, + 23: __ccgo_ts + 16705, + 24: __ccgo_ts + 16772, + 25: __ccgo_ts + 16777, + 26: __ccgo_ts + 16782, + 27: __ccgo_ts + 16705, + 28: __ccgo_ts + 16786, + 29: __ccgo_ts + 16710, + 30: __ccgo_ts + 16794, + 31: __ccgo_ts + 16798, + 32: __ccgo_ts + 16803, + 33: __ccgo_ts + 11984, + 34: __ccgo_ts + 11980, + 35: __ccgo_ts + 16809, + 36: __ccgo_ts + 16814, + 37: __ccgo_ts + 16819, + 38: __ccgo_ts + 16663, + 39: __ccgo_ts + 16705, + 40: __ccgo_ts + 16824, + 41: __ccgo_ts + 16831, + 42: __ccgo_ts + 16838, + 43: __ccgo_ts + 9245, + 44: __ccgo_ts + 16846, + 45: __ccgo_ts + 5565, + 46: __ccgo_ts + 16852, + 47: __ccgo_ts + 16663, + 48: __ccgo_ts + 16705, + 49: __ccgo_ts + 16857, + 50: __ccgo_ts + 16862, + 51: __ccgo_ts + 16048, + 52: __ccgo_ts + 16867, + 53: __ccgo_ts + 16880, + 54: __ccgo_ts + 16889, + 55: __ccgo_ts + 16896, + 56: __ccgo_ts + 16907, } // C documentation @@ -112338,191 +113028,191 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16850, + FzName: __ccgo_ts + 16915, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16865, + FzName: __ccgo_ts + 16930, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16880, + FzName: __ccgo_ts + 16945, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16892, + FzName: __ccgo_ts + 16957, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16908, + FzName: __ccgo_ts + 16973, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16831, + FzName: __ccgo_ts + 16896, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 16921, + FzName: __ccgo_ts + 16986, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 16933, + FzName: __ccgo_ts + 16998, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 16953, + FzName: __ccgo_ts + 17018, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 16969, + FzName: __ccgo_ts + 17034, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 16990, + FzName: __ccgo_ts + 17055, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(38), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17005, + FzName: __ccgo_ts + 17070, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17021, + FzName: __ccgo_ts + 17086, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17035, + FzName: __ccgo_ts + 17100, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17048, + FzName: __ccgo_ts + 17113, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(47), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17062, + FzName: __ccgo_ts + 17127, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17081, + FzName: __ccgo_ts + 17146, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17100, + FzName: __ccgo_ts + 17165, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17123, + FzName: __ccgo_ts + 17188, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17132, + FzName: __ccgo_ts + 17197, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17150, + FzName: __ccgo_ts + 17215, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17167, + FzName: __ccgo_ts + 17232, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17180, + FzName: __ccgo_ts + 17245, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17195, + FzName: __ccgo_ts + 17260, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17213, + FzName: __ccgo_ts + 17278, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17223, + FzName: __ccgo_ts + 17288, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(27), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17237, + FzName: __ccgo_ts + 17302, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17253, + FzName: __ccgo_ts + 17318, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17278, + FzName: __ccgo_ts + 17343, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17297, + FzName: __ccgo_ts + 17362, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(21), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17308, + FzName: __ccgo_ts + 17373, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(38), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17319, + FzName: __ccgo_ts + 17384, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(21), @@ -112530,146 +113220,146 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17331, + FzName: __ccgo_ts + 17396, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17347, + FzName: __ccgo_ts + 17412, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17360, + FzName: __ccgo_ts + 17425, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17379, + FzName: __ccgo_ts + 17444, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17398, + FzName: __ccgo_ts + 17463, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17411, + FzName: __ccgo_ts + 17476, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17426, + FzName: __ccgo_ts + 17491, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17436, + FzName: __ccgo_ts + 17501, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17448, + FzName: __ccgo_ts + 17513, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17457, + FzName: __ccgo_ts + 17522, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17468, + FzName: __ccgo_ts + 17533, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17478, + FzName: __ccgo_ts + 17543, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17490, + FzName: __ccgo_ts + 17555, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17501, + FzName: __ccgo_ts + 17566, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17513, + FzName: __ccgo_ts + 17578, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17530, + FzName: __ccgo_ts + 17595, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17549, + FzName: __ccgo_ts + 17614, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17575, + FzName: __ccgo_ts + 17640, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17590, + FzName: __ccgo_ts + 17655, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17604, + FzName: __ccgo_ts + 17669, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17623, + FzName: __ccgo_ts + 17688, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17637, + FzName: __ccgo_ts + 17702, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17653, + FzName: __ccgo_ts + 17718, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17665, + FzName: __ccgo_ts + 17730, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17676, + FzName: __ccgo_ts + 17741, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), FiPragCName: uint8(15), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17687, + FzName: __ccgo_ts + 17752, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -112677,45 +113367,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17699, + FzName: __ccgo_ts + 17764, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17710, + FzName: __ccgo_ts + 17775, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17731, + FzName: __ccgo_ts + 17796, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17739, + FzName: __ccgo_ts + 17804, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17754, + FzName: __ccgo_ts + 17819, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17767, + FzName: __ccgo_ts + 17832, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17786, + FzName: __ccgo_ts + 17851, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), FiPragCName: uint8(50), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17801, + FzName: __ccgo_ts + 17866, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -112841,10 +113531,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17817) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17882) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17827) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17892) { return PAGER_LOCKINGMODE_NORMAL } } @@ -112862,13 +113552,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8343) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8405) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17834) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17899) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17839) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17904) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -112891,10 +113581,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) <= int32('2') { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16792) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16857) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17851) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17916) == 0 { return int32(2) } else { return 0 @@ -112916,7 +113606,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17858, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17923, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -113046,15 +113736,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17920 + zName = __ccgo_ts + 17985 case int32(OE_SetDflt): - zName = __ccgo_ts + 17929 + zName = __ccgo_ts + 17994 case int32(OE_Cascade): - zName = __ccgo_ts + 17941 + zName = __ccgo_ts + 18006 case int32(OE_Restrict): - zName = __ccgo_ts + 17949 + zName = __ccgo_ts + 18014 default: - zName = __ccgo_ts + 17958 + zName = __ccgo_ts + 18023 break } return zName @@ -113075,12 +113765,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 17968, - 1: __ccgo_ts + 17975, - 2: __ccgo_ts + 17983, - 3: __ccgo_ts + 17987, - 4: __ccgo_ts + 17851, - 5: __ccgo_ts + 17996, + 0: __ccgo_ts + 18033, + 1: __ccgo_ts + 18040, + 2: __ccgo_ts + 18048, + 3: __ccgo_ts + 18052, + 4: __ccgo_ts + 17916, + 5: __ccgo_ts + 18061, } // C documentation @@ -113142,15 +113832,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18021 + zType = __ccgo_ts + 18086 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18023 + zType = __ccgo_ts + 18088 } else { - zType = __ccgo_ts + 7742 + zType = __ccgo_ts + 7804 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18025, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18090, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -113159,9 +113849,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18000, - 2: __ccgo_ts + 18005, - 3: __ccgo_ts + 18013, + 1: __ccgo_ts + 18065, + 2: __ccgo_ts + 18070, + 3: __ccgo_ts + 18078, } // C documentation @@ -113260,7 +113950,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18032, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18097, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -113303,7 +113993,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3859, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -113348,7 +114038,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -113407,7 +114097,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18036) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18101) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -113450,7 +114140,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 56 + v5 = pParse + 60 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -113478,7 +114168,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17827 + zRet = __ccgo_ts + 17892 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -113506,7 +114196,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17817 + zRet = __ccgo_ts + 17882 } _returnSingleText(tls, v, zRet) break @@ -113796,7 +114486,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*uint8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18041, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18106, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -113806,7 +114496,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*uint8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -113828,7 +114518,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18066, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18131, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -113861,7 +114551,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18119) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18184) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -113941,9 +114631,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18125 + v14 = __ccgo_ts + 18190 } else { - v14 = __ccgo_ts + 18133 + v14 = __ccgo_ts + 18198 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -113955,7 +114645,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v16 = *(*uintptr)(unsafe.Pointer(pColExpr + 8)) } - _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1662), v15, v16, k, isHidden)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1663), v15, v16, k, isHidden)) goto _12 _12: ; @@ -114014,15 +114704,15 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18140, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18205, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 80)) = uintptr(0) - Xsqlite3_prepare(tls, db, zSql, -int32(1), bp+80, uintptr(0)) + Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+80, uintptr(0)) Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 80))) _sqlite3DbFree(tls, db, zSql) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1632, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1633, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) } pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FpSchema + 8 @@ -114044,19 +114734,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10921 + zType = __ccgo_ts + 10983 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13169 + zType = __ccgo_ts + 13231 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18156 + zType = __ccgo_ts + 18221 } else { - zType = __ccgo_ts + 9183 + zType = __ccgo_ts + 9245 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18163, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18228, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -114103,9 +114793,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18170, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18235, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18175, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18240, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -114129,11 +114819,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18180, - 1: __ccgo_ts + 18182, - 2: __ccgo_ts + 16669, + 0: __ccgo_ts + 18245, + 1: __ccgo_ts + 18247, + 2: __ccgo_ts + 16734, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18184, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18249, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -114152,7 +114842,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18190, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18255, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -114169,7 +114859,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18194, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18259, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -114219,7 +114909,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7742, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7804, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -114231,7 +114921,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1584)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7742, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7804, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -114257,7 +114947,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18197, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18206)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18262, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18271)) goto _32 _32: ; @@ -114271,8 +114961,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(4) - v34 = pParse + 56 + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) + v34 = pParse + 60 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -114398,7 +115088,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18211, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18276, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96))) @@ -114583,12 +115273,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*int32)(unsafe.Pointer(aRoot)) = cnt /* Make sure sufficient number of registers have been allocated */ _sqlite3TouchRegister(tls, pParse, int32(8)+cnt) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, int32(8), int32(8)+cnt) _sqlite3ClearTempRegCache(tls, pParse) /* Do the b-tree integrity checks */ _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) - _sqlite3VdbeChangeP5(tls, v, uint16(libc.Uint8FromInt32(i9))) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18215, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18280, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -114599,7 +115290,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18239) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18304) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -114735,7 +115426,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 108)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18268, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18333, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -114819,7 +115510,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18304, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18369, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -114832,7 +115523,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18324, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18389, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -114840,7 +115531,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18346, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18411, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -114851,10 +115542,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 108)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18369, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18434, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18371, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18436, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -114888,7 +115579,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18391, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18456, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -114912,9 +115603,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 112))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18421) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18486) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18426) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18491) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -114927,9 +115618,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 112))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18447) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18512) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18483) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18548) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -114957,9 +115648,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18421) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18486) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18494) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18559) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -114987,7 +115678,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 112))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18521) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18586) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -115084,7 +115775,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 104)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18548 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18613 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -115163,7 +115854,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18609, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18674, libc.VaList(bp+176, zRight)) } } } @@ -115268,13 +115959,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17834) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17899) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18634) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18699) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17987) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18052) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -115409,7 +116100,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 52 + v70 = pParse + 56 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -115439,7 +116130,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6589, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6651, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -115501,7 +116192,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18642, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18707, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -115774,34 +116465,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18551, + FzName: __ccgo_ts + 18616, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18556, + FzName: __ccgo_ts + 18621, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18562, + FzName: __ccgo_ts + 18627, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18571, + FzName: __ccgo_ts + 18636, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18580, + FzName: __ccgo_ts + 18645, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18588, + FzName: __ccgo_ts + 18653, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18596, + FzName: __ccgo_ts + 18661, }, 7: { - FzName: __ccgo_ts + 18603, + FzName: __ccgo_ts + 18668, }, 8: {}, } @@ -115897,14 +116588,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18660) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18725) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18675, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18740, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -115913,19 +116604,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18682, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18747, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18688) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18753) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18700) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18765) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5170, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -115940,7 +116631,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -116121,7 +116812,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -116133,13 +116824,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18715) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18780) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18723, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18788, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18727, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18792, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -116148,7 +116839,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -116274,24 +116965,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18761, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18826, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(141849)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5172 + v1 = __ccgo_ts + 5173 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18789, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18854, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18820, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18885, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(141856)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) } } } @@ -116299,9 +116990,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18731, - 1: __ccgo_ts + 18738, - 2: __ccgo_ts + 18750, + 0: __ccgo_ts + 18796, + 1: __ccgo_ts + 18803, + 2: __ccgo_ts + 18815, } // C documentation @@ -116377,7 +117068,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14609) + _corruptSchema(tls, pData, argv, __ccgo_ts+14671) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -116410,11 +117101,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18828) + _corruptSchema(tls, pData, argv, __ccgo_ts+18893) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14609) + _corruptSchema(tls, pData, argv, __ccgo_ts+14671) } } } @@ -116453,18 +117144,18 @@ func _sqlite3InitOne(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. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9183 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9245 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6597 + v2 = __ccgo_ts + 6659 } else { - v2 = __ccgo_ts + 6130 + v2 = __ccgo_ts + 6147 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8255 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18841 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8317 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18906 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -116544,16 +117235,11 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl if libc.Int32FromUint8(encoding) == 0 { encoding = uint8(SQLITE_UTF8) } - if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > 0 && libc.Int32FromUint8(encoding) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) && (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags&uint32(DBFLAG_Vacuum) == uint32(0) { - rc = int32(SQLITE_LOCKED) - goto initone_error_out - } else { - _sqlite3SetTextEncoding(tls, db, encoding) - } + _sqlite3SetTextEncoding(tls, db, encoding) } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12220) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12282) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -116579,7 +117265,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18913) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18978) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -116594,7 +117280,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18937, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19002, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -116929,7 +117615,7 @@ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1632, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1633, 0) } } @@ -116963,7 +117649,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } else { } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1632, 0) + _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1633, 0) v1 = libc.Int32FromInt32(SQLITE_NOMEM) rc = v1 (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = v1 @@ -117012,7 +117698,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+18971, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19036, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -117028,7 +117714,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19001, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19066, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -117062,7 +117748,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3859, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3860, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -117092,7 +117778,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(142663)) + return _sqlite3MisuseError(tls, int32(143609)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -117218,16 +117904,21 @@ func Xsqlite3_prepare_v3(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prepFlags Tu32, ppStmt uintptr, pzTail uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var chars_parsed, rc, sz int32 - var z, zSql8 uintptr + var chars_parsed, rc, sz, sz1 int32 + var z, z1, zSql8 uintptr var _ /* zTail8 at bp+0 */ uintptr - _, _, _, _, _ = chars_parsed, rc, sz, z, zSql8 + _, _, _, _, _, _, _ = chars_parsed, rc, sz, sz1, z, z1, zSql8 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(142812)) + return _sqlite3MisuseError(tls, int32(143758)) } + /* Make sure nBytes is non-negative and correct. It should be the + ** number of bytes until the end of the input buffer or until the first + ** U+0000 character. If the input nBytes is odd, convert it into + ** an even number. If the input nBytes is negative, then the input + ** must be terminated by at least one U+0000 character */ if nBytes >= 0 { z = zSql sz = 0 @@ -117241,6 +117932,19 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr sz += int32(2) } nBytes = sz + } else { + z1 = zSql + sz1 = 0 + for { + if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z1 + uintptr(sz1)))) != 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z1 + uintptr(sz1+int32(1))))) != 0) { + break + } + goto _2 + _2: + ; + sz1 += int32(2) + } + nBytes = sz1 } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zSql8 = _sqlite3Utf16to8(tls, db, zSql, nBytes, uint8(SQLITE_UTF16LE)) @@ -117254,7 +117958,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr ** the same number of characters into the UTF-16 string. */ chars_parsed = _sqlite3Utf8CharLen(tls, zSql8, int32(int64(*(*uintptr)(unsafe.Pointer(bp)))-int64(zSql8))) - *(*uintptr)(unsafe.Pointer(pzTail)) = zSql + uintptr(_sqlite3Utf16ByteLen(tls, zSql, chars_parsed)) + *(*uintptr)(unsafe.Pointer(pzTail)) = zSql + uintptr(_sqlite3Utf16ByteLen(tls, zSql, nBytes, chars_parsed)) } _sqlite3DbFree(tls, db, zSql8) rc = _sqlite3ApiExit(tls, db, rc) @@ -117476,7 +118180,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(112)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -117632,15 +118336,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11327 - zSp2 = __ccgo_ts + 11327 + zSp1 = __ccgo_ts + 11389 + zSp2 = __ccgo_ts + 11389 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19020, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19085, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -117728,8 +118432,8 @@ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { func _sqlite3SrcItemColumnUsed(tls *libc.TLS, pItem uintptr, iCol int32) { var pResults uintptr _ = pResults - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2000>>13)) != 0 { - pResults = (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpEList + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + pResults = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect)).FpEList libc.SetBitFieldPtr16Uint32(pResults+8+uintptr(iCol)*32+16+4, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -117755,10 +118459,10 @@ func _tableAndColumnIndex(tls *libc.TLS, pSrc uintptr, iStart int32, iEnd int32, if !(i <= iEnd) { break } - iCol = _sqlite3ColumnIndex(tls, (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104))).FpTab, zCol) - if iCol >= 0 && (bIgnoreHidden == 0 || libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104))).FpTab)).FaCol+uintptr(iCol)*16)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0) == 0) { + iCol = _sqlite3ColumnIndex(tls, (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80))).FpSTab, zCol) + if iCol >= 0 && (bIgnoreHidden == 0 || libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80))).FpSTab)).FaCol+uintptr(iCol)*16)).FcolFlags)&int32(COLFLAG_HIDDEN) != 0) == 0) { if piTab != 0 { - _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(i)*104, iCol) + _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(i)*80, iCol) *(*int32)(unsafe.Pointer(piTab)) = i *(*int32)(unsafe.Pointer(piCol)) = iCol } @@ -117909,14 +118613,14 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, i, iRightCol, j, joinType, pE1, pE2, pEq, pFuncArgs, pLeft, pList, pRight, pRightTab, pSrc, pUsing, zName, zName1, v2 /* Right table being joined */ pSrc = (*TSelect)(unsafe.Pointer(p)).FpSrc pLeft = pSrc + 8 - pRight = pLeft + 1*104 + pRight = pLeft + 1*80 i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc-int32(1)) { break } - pRightTab = (*TSrcItem)(unsafe.Pointer(pRight)).FpTab - if (*TSrcItem)(unsafe.Pointer(pLeft)).FpTab == uintptr(0) || pRightTab == uintptr(0) { + pRightTab = (*TSrcItem)(unsafe.Pointer(pRight)).FpSTab + if (*TSrcItem)(unsafe.Pointer(pLeft)).FpSTab == uintptr(0) || pRightTab == uintptr(0) { goto _1 } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_OUTER) != 0 { @@ -117930,8 +118634,8 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) - if int32(uint32(*(*uint16)(unsafe.Pointer(pRight + 60 + 4))&0x400>>10)) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 72)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19050, libc.VaList(bp+16, 0)) + if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19115, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -117946,7 +118650,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if _tableAndColumnIndex(tls, pSrc, 0, i, zName, uintptr(0), uintptr(0), int32(1)) != 0 { pUsing = _sqlite3IdListAppend(tls, pParse, pUsing, uintptr(0)) if pUsing != 0 { - (*(*TIdList_item)(unsafe.Pointer(pUsing + 8 + uintptr((*TIdList)(unsafe.Pointer(pUsing)).FnId-int32(1))*16))).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zName) + (*(*TIdList_item)(unsafe.Pointer(pUsing + 8 + uintptr((*TIdList)(unsafe.Pointer(pUsing)).FnId-int32(1))*8))).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zName) } } goto _3 @@ -117955,9 +118659,9 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { j++ } if pUsing != 0 { - libc.SetBitFieldPtr16Uint32(pRight+60+4, libc.Uint32FromInt32(1), 10, 0x400) - libc.SetBitFieldPtr16Uint32(pRight+60+4, libc.Uint32FromInt32(1), 12, 0x1000) - *(*uintptr)(unsafe.Pointer(pRight + 72)) = pUsing + libc.SetBitFieldPtr32Uint32(pRight+24+4, libc.Uint32FromInt32(1), 11, 0x800) + libc.SetBitFieldPtr32Uint32(pRight+24+4, libc.Uint32FromInt32(1), 13, 0x2000) + *(*uintptr)(unsafe.Pointer(pRight + 64)) = pUsing } if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(1) @@ -117970,22 +118674,22 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** Report an error if any column mentioned in the USING clause is ** not contained in both tables to be joined. */ - if int32(uint32(*(*uint16)(unsafe.Pointer(pRight + 60 + 4))&0x400>>10)) != 0 { - pList = *(*uintptr)(unsafe.Pointer(pRight + 72)) + if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 { + pList = *(*uintptr)(unsafe.Pointer(pRight + 64)) db = (*TParse)(unsafe.Pointer(pParse)).Fdb j = 0 for { if !(j < (*TIdList)(unsafe.Pointer(pList)).FnId) { break } /* Equality constraint. pE1 == pE2 */ - zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*16))).FzName + zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) - if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(uint32(*(*uint16)(unsafe.Pointer(pRight + 60 + 4))&0x1000>>12))) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19100, libc.VaList(bp+16, zName1)) + if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19165, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) - _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*104, *(*int32)(unsafe.Pointer(bp + 4))) + _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join @@ -118001,14 +118705,14 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ - for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(uint32(*(*uint16)(unsafe.Pointer(pRight + 60 + 4))&0x1000>>12))) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*104 + 60 + 4))&0x400>>10)) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*104 + 72)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19164, libc.VaList(bp+16, zName1)) + for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19229, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) - _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*104, *(*int32)(unsafe.Pointer(bp + 4))) + _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) } if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -118029,25 +118733,25 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { j++ } } else { - if *(*uintptr)(unsafe.Pointer(pRight + 72)) != 0 { - _sqlite3SetJoinExpr(tls, *(*uintptr)(unsafe.Pointer(pRight + 72)), (*TSrcItem)(unsafe.Pointer(pRight)).FiCursor, joinType) - (*TSelect)(unsafe.Pointer(p)).FpWhere = _sqlite3ExprAnd(tls, pParse, (*TSelect)(unsafe.Pointer(p)).FpWhere, *(*uintptr)(unsafe.Pointer(pRight + 72))) - *(*uintptr)(unsafe.Pointer(pRight + 72)) = uintptr(0) - libc.SetBitFieldPtr16Uint32(pRight+60+4, libc.Uint32FromInt32(1), 11, 0x800) + if *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { + _sqlite3SetJoinExpr(tls, *(*uintptr)(unsafe.Pointer(pRight + 64)), (*TSrcItem)(unsafe.Pointer(pRight)).FiCursor, joinType) + (*TSelect)(unsafe.Pointer(p)).FpWhere = _sqlite3ExprAnd(tls, pParse, (*TSelect)(unsafe.Pointer(p)).FpWhere, *(*uintptr)(unsafe.Pointer(pRight + 64))) + *(*uintptr)(unsafe.Pointer(pRight + 64)) = uintptr(0) + libc.SetBitFieldPtr32Uint32(pRight+24+4, libc.Uint32FromInt32(1), 12, 0x1000) } } goto _1 _1: ; i++ - pRight += 104 - pLeft += 104 + pRight += 80 + pLeft += 80 } return 0 } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6794, + Fz: __ccgo_ts + 6856, Fn: uint32(8), } @@ -118095,7 +118799,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -118140,7 +118844,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nBase + *(*int32)(unsafe.Pointer(pParse + 60)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -118164,7 +118868,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -118185,7 +118889,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 56 + v4 = pParse + 60 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -118308,7 +119012,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -118435,10 +119139,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 56)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -118446,7 +119150,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 56)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -118616,10 +119320,15 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** does not matter. But there might be a LIMIT clause, in which ** case the order does matter */ _pushOntoSorter(tls, pParse, pSort, p, regResult, regOrig, nResultCol, nPrefixReg) + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = 0 /* Signal that any Bloom filter is unpopulated */ } else { r13 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regResult, nResultCol, r13, (*TSelectDest)(unsafe.Pointer(pDest)).FzAffSdst, nResultCol) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) + if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19266, 0) + } _sqlite3ReleaseTempReg(tls, pParse, r13) } break @@ -118823,13 +119532,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19201 + z = __ccgo_ts + 19286 case int32(TK_INTERSECT): - z = __ccgo_ts + 19211 + z = __ccgo_ts + 19296 case int32(TK_EXCEPT): - z = __ccgo_ts + 19221 + z = __ccgo_ts + 19306 default: - z = __ccgo_ts + 19228 + z = __ccgo_ts + 19313 break } return z @@ -118850,7 +119559,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19234, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19319, libc.VaList(bp+8, zUsage)) } /* @@ -118887,13 +119596,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19257 + v1 = __ccgo_ts + 19342 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19271, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19356, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19302, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19387, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -118917,11 +119626,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 56 + v3 = pParse + 60 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 52 + v5 = pParse + 56 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -119079,7 +119788,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr pTabList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList j = 0 for { - if !(j < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc && (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*104))).FiCursor != (*TExpr)(unsafe.Pointer(pExpr)).FiTable) { + if !(j < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc && (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*80))).FiCursor != (*TExpr)(unsafe.Pointer(pExpr)).FiTable) { break } goto _1 @@ -119088,8 +119797,12 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr j++ } if j < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc { - pTab = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*104))).FpTab - pS = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*104))).FpSelect + pTab = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*80))).FpSTab + if int32(*(*uint32)(unsafe.Pointer(pTabList + 8 + uintptr(j)*80 + 24 + 4))&0x4>>2) != 0 { + pS = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTabList + 8 + uintptr(j)*80 + 72)))).FpSelect + } else { + pS = uintptr(0) + } } else { pNC = (*TNameContext)(unsafe.Pointer(pNC)).FpNext } @@ -119132,8 +119845,8 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zType = __ccgo_ts + 1136 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16781 + zType = __ccgo_ts + 1137 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16846 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -119279,13 +119992,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16781 + zCol = __ccgo_ts + 16846 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12506, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -119293,7 +120006,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19348, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19433, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -119385,7 +120098,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 16781 + v3 = __ccgo_ts + 16846 } zName = v3 } else { @@ -119400,7 +120113,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19348, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19433, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -119436,7 +120149,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19357, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19442, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -119555,7 +120268,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != libc.Int32FromUint8(_sqlite3AffinityType(tls, zType, uintptr(0))) { if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19365 + zType = __ccgo_ts + 19450 } else { zType = uintptr(0) j = int32(1) @@ -119699,14 +120412,14 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 56 + v3 = pParse + 60 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 iLimit = v1 (*TSelect)(unsafe.Pointer(p)).FiLimit = v1 v = _sqlite3GetVdbe(tls, pParse) - if _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer(pLimit)).FpLeft, bp) != 0 { + if _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer(pLimit)).FpLeft, bp, pParse) != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), *(*int32)(unsafe.Pointer(bp)), iLimit) if *(*int32)(unsafe.Pointer(bp)) == 0 { _sqlite3VdbeGoto(tls, v, iBreak) @@ -119722,7 +120435,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 56 + v6 = pParse + 60 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -119870,7 +120583,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19369, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19454, 0) return } /* Obtain authorization to do a recursive query */ @@ -119895,8 +120608,8 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest if !(i < (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) { break } - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 60 + 4))&0x40>>6)) != 0 { - iCurrent = (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104))).FiCursor + if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80 + 24 + 4))&0x80>>7) != 0 { + iCurrent = (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80))).FiCursor break } goto _2 @@ -119907,7 +120620,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 52 + v4 = pParse + 56 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -119918,7 +120631,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 52 + v7 = pParse + 56 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -119932,7 +120645,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 56 + v10 = pParse + 60 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -119963,7 +120676,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19418, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19503, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -119978,7 +120691,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19460, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19545, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -120006,7 +120719,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19466, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19551, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -120059,11 +120772,11 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) nRow += bShowAll } if nRow == int32(1) { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } else { - v1 = __ccgo_ts + 19481 + v1 = __ccgo_ts + 19566 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19483, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19568, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -120171,8 +120884,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19506, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19521, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19591, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19606, 0) } /* Generate code for the left and right SELECT statements. */ @@ -120197,12 +120910,12 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19201, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19286, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3LogEstAdd(tls, (*TSelect)(unsafe.Pointer(p)).FnSelectRow, (*TSelect)(unsafe.Pointer(pPrior)).FnSelectRow) - if (*TSelect)(unsafe.Pointer(p)).FpLimit != 0 && _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpLimit)).FpLeft, bp+40) != 0 && *(*int32)(unsafe.Pointer(bp + 40)) > 0 && int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) > int32(_sqlite3LogEst(tls, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 40))))) { + if (*TSelect)(unsafe.Pointer(p)).FpLimit != 0 && _sqlite3ExprIsInteger(tls, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpLimit)).FpLeft, bp+40, pParse) != 0 && *(*int32)(unsafe.Pointer(bp + 40)) > 0 && int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) > int32(_sqlite3LogEst(tls, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 40))))) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 40)))) } if addr != 0 { @@ -120223,7 +120936,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 52 + v2 = pParse + 56 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -120249,7 +120962,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19540, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19625, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -120281,11 +120994,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 52 + v4 = pParse + 56 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 52 + v6 = pParse + 56 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -120307,7 +121020,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19540, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19625, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -120430,9 +121143,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19561, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19646, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19607, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19692, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -120501,6 +121214,10 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst, r11, (*TSelectDest)(unsafe.Pointer(pDest)).FzAffSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) + if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19266, 0) + } _sqlite3ReleaseTempReg(tls, pParse, r11) break /* If this is a scalar select that is part of an expression, then @@ -120747,7 +121464,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -120801,16 +121518,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7492) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7492) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7554) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7554) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 56 + v10 = pParse + 60 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 56 + v12 = pParse + 60 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -120828,32 +121545,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 56 + v16 = pParse + 60 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 56 + v18 = pParse + 60 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 56 + v20 = pParse + 60 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 56 + v22 = pParse + 60 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19689, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19774, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19700, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19785, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -120866,7 +121583,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19705, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19790, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -121063,29 +121780,29 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if (*TSubstContext)(unsafe.Pointer(pSubst)).FisOuterJoin != 0 { *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { - _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) - } - _sqlite3ExprDelete(tls, db, pExpr) - pExpr = pNew - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_TRUEFALSE) { - *(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fu)) = _sqlite3ExprTruthValue(tls, pExpr) - (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_INTEGER) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue)) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pNew)).Fop) == int32(TK_TRUEFALSE) { + *(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pNew)).Fu)) = _sqlite3ExprTruthValue(tls, pNew) + (*TExpr)(unsafe.Pointer(pNew)).Fop = uint8(TK_INTEGER) + *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IntValue)) } /* Ensure that the expression now has an implicit collation sequence, ** just as it did when it was a column of a view or sub-query. */ - pNat = _sqlite3ExprCollSeq(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pExpr) + pNat = _sqlite3ExprCollSeq(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew) pColl = _sqlite3ExprCollSeq(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, (*(*TExprList_item)(unsafe.Pointer((*TSubstContext)(unsafe.Pointer(pSubst)).FpCList + 8 + uintptr(iColumn)*32))).FpExpr) - if pNat != pColl || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLLATE) { + if pNat != pColl || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pNew)).Fop) != int32(TK_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pNew)).Fop) != int32(TK_COLLATE) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5150 + v1 = __ccgo_ts + 5151 } - pExpr = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pExpr, v1) + pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) + } + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { + _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + _sqlite3ExprDelete(tls, db, pExpr) + pExpr = pNew } } else { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IF_NULL_ROW) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TSubstContext)(unsafe.Pointer(pSubst)).FiTable { @@ -121148,15 +121865,17 @@ func _substSelect(tls *libc.TLS, pSubst uintptr, p uintptr, doPrior int32) { if !(i > 0) { break } - _substSelect(tls, pSubst, (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect, int32(1)) - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x4>>2)) != 0 { - _substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pItem + 88))) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { + _substSelect(tls, pSubst, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect, int32(1)) + } + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x8>>3) != 0 { + _substExprList(tls, pSubst, *(*uintptr)(unsafe.Pointer(pItem + 48))) } goto _4 _4: ; i-- - pItem += 104 + pItem += 80 } goto _3 _3: @@ -121193,7 +121912,7 @@ func _recomputeColumnsUsedExpr(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r if int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) < 0 { return WRC_Continue } - *(*TBitmask)(unsafe.Pointer(pItem + 80)) |= _sqlite3ExprColUsed(tls, pExpr) + *(*TBitmask)(unsafe.Pointer(pItem + 40)) |= _sqlite3ExprColUsed(tls, pExpr) return WRC_Continue } @@ -121201,7 +121920,7 @@ func _recomputeColumnsUsed(tls *libc.TLS, pSelect uintptr, pSrcItem uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* w at bp+0 */ TWalker - if (*TSrcItem)(unsafe.Pointer(pSrcItem)).FpTab == uintptr(0) { + if (*TSrcItem)(unsafe.Pointer(pSrcItem)).FpSTab == uintptr(0) { return } libc.Xmemset(tls, bp, 0, uint64(48)) @@ -121238,30 +121957,32 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr break } if i != iExcept { - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x40>>6)) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 52 + if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { + v3 = pParse + 56 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 } (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) - p = (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect - for { - if !(p != 0) { - break + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { + p = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect + for { + if !(p != 0) { + break + } + _srclistRenumberCursors(tls, pParse, aCsrMap, (*TSelect)(unsafe.Pointer(p)).FpSrc, -int32(1)) + goto _4 + _4: + ; + p = (*TSelect)(unsafe.Pointer(p)).FpPrior } - _srclistRenumberCursors(tls, pParse, aCsrMap, (*TSelect)(unsafe.Pointer(p)).FpSrc, -int32(1)) - goto _4 - _4: - ; - p = (*TSelect)(unsafe.Pointer(p)).FpPrior } } goto _1 _1: ; i++ - pItem += 104 + pItem += 80 } } @@ -121580,9 +122301,9 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA return 0 } pSrc = (*TSelect)(unsafe.Pointer(p)).FpSrc - pSubitem = pSrc + 8 + uintptr(iFrom)*104 + pSubitem = pSrc + 8 + uintptr(iFrom)*80 iParent = (*TSrcItem)(unsafe.Pointer(pSubitem)).FiCursor - pSub = (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSelect + pSub = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pSubitem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 || (*TSelect)(unsafe.Pointer(pSub)).FpWin != 0 { return 0 } /* Restriction (25) */ @@ -121641,7 +122362,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -121725,14 +122446,15 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA _sqlite3AuthCheck(tls, pParse, int32(SQLITE_SELECT), uintptr(0), uintptr(0), uintptr(0)) (*TParse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext /* Delete the transient structures associated with the subquery */ - pSub1 = (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSelect - _sqlite3DbFree(tls, db, (*TSrcItem)(unsafe.Pointer(pSubitem)).FzDatabase) + if int32(*(*uint32)(unsafe.Pointer(pSubitem + 24 + 4))&0x4>>2) != 0 { + pSub1 = _sqlite3SubqueryDetach(tls, db, pSubitem) + } else { + pSub1 = uintptr(0) + } _sqlite3DbFree(tls, db, (*TSrcItem)(unsafe.Pointer(pSubitem)).FzName) _sqlite3DbFree(tls, db, (*TSrcItem)(unsafe.Pointer(pSubitem)).FzAlias) - (*TSrcItem)(unsafe.Pointer(pSubitem)).FzDatabase = uintptr(0) (*TSrcItem)(unsafe.Pointer(pSubitem)).FzName = uintptr(0) (*TSrcItem)(unsafe.Pointer(pSubitem)).FzAlias = uintptr(0) - (*TSrcItem)(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: @@ -121774,8 +122496,8 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA pOrderBy = (*TSelect)(unsafe.Pointer(p)).FpOrderBy pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit pPrior = (*TSelect)(unsafe.Pointer(p)).FpPrior - pItemTab = (*TSrcItem)(unsafe.Pointer(pSubitem)).FpTab - (*TSrcItem)(unsafe.Pointer(pSubitem)).FpTab = uintptr(0) + pItemTab = (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSTab = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) @@ -121783,7 +122505,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA (*TSelect)(unsafe.Pointer(p)).FpLimit = pLimit (*TSelect)(unsafe.Pointer(p)).FpOrderBy = pOrderBy (*TSelect)(unsafe.Pointer(p)).Fop = uint8(TK_ALL) - (*TSrcItem)(unsafe.Pointer(pSubitem)).FpTab = pItemTab + (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSTab = pItemTab if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { @@ -121808,7 +122530,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA } _sqlite3DbFree(tls, db, aCsrMap) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSelect = pSub1 + _sqlite3SrcItemAttachSubquery(tls, pParse, pSubitem, pSub1, 0) return int32(1) } /* Defer deleting the Table object associated with the @@ -121818,8 +122540,8 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** ** pSubitem->pTab is always non-NULL by test restrictions and tests above. */ - if (*TSrcItem)(unsafe.Pointer(pSubitem)).FpTab != uintptr(0) { - pTabToDel = (*TSrcItem)(unsafe.Pointer(pSubitem)).FpTab + if (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSTab != uintptr(0) { + pTabToDel = (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSTab if (*TTable)(unsafe.Pointer(pTabToDel)).FnTabRef == uint32(1) { if (*TParse)(unsafe.Pointer(pParse)).FpToplevel != 0 { v6 = (*TParse)(unsafe.Pointer(pParse)).FpToplevel @@ -121831,7 +122553,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA } else { (*TTable)(unsafe.Pointer(pTabToDel)).FnTabRef-- } - (*TSrcItem)(unsafe.Pointer(pSubitem)).FpTab = uintptr(0) + (*TSrcItem)(unsafe.Pointer(pSubitem)).FpSTab = uintptr(0) } /* The following loop runs once for each term in a compound-subquery ** flattening (as described above). If we are doing a different kind @@ -121853,7 +122575,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA break } jointype = uint8(0) - ltorj = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(iFrom)*104))).Ffg.Fjointype) & int32(JT_LTORJ)) + ltorj = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(iFrom)*80))).Ffg.Fjointype) & int32(JT_LTORJ)) pSubSrc = (*TSelect)(unsafe.Pointer(pSub)).FpSrc /* FROM clause of subquery */ nSubSrc = (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc /* Number of terms in subquery FROM clause */ pSrc = (*TSelect)(unsafe.Pointer(pParent)).FpSrc /* FROM clause of the outer query */ @@ -121885,28 +122607,28 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA /* Transfer the FROM clause terms from the subquery into the ** outer query. */ + iNewParent = (*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FiCursor i = 0 for { if !(i < nSubSrc) { break } - pItem = pSrc + 8 + uintptr(i+iFrom)*104 - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x400>>10)) != 0 { - _sqlite3IdListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) + pItem = pSrc + 8 + uintptr(i+iFrom)*80 + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) != 0 { + _sqlite3IdListDelete(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 64))) } - *(*TSrcItem)(unsafe.Pointer(pItem)) = *(*TSrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*104)) - p9 = pItem + 60 + *(*TSrcItem)(unsafe.Pointer(pItem)) = *(*TSrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*80)) + p9 = pItem + 24 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) | libc.Int32FromUint8(ltorj)) - iNewParent = (*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8 + uintptr(i)*104))).FiCursor - libc.Xmemset(tls, pSubSrc+8+uintptr(i)*104, 0, uint64(104)) + libc.Xmemset(tls, pSubSrc+8+uintptr(i)*80, 0, uint64(80)) goto _8 _8: ; i++ } - p10 = pSrc + 8 + uintptr(iFrom)*104 + 60 + p10 = pSrc + 8 + uintptr(iFrom)*80 + 24 *(*Tu8)(unsafe.Pointer(p10)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p10))) & libc.Int32FromInt32(JT_LTORJ)) - p11 = pSrc + 8 + uintptr(iFrom)*104 + 60 + p11 = pSrc + 8 + uintptr(iFrom)*80 + 24 *(*Tu8)(unsafe.Pointer(p11)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p11))) | (libc.Int32FromUint8(jointype) | libc.Int32FromUint8(ltorj))) /* Now begin substituting subquery result set expressions for ** references to the iParent in the outer query. @@ -121988,7 +122710,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if !(i < nSubSrc) { break } - _recomputeColumnsUsed(tls, pParent, pSrc+8+uintptr(i+iFrom)*104) + _recomputeColumnsUsed(tls, pParent, pSrc+8+uintptr(i+iFrom)*80) goto _13 _13: ; @@ -122355,7 +123077,8 @@ func _pushDownWindowCheck(tls *libc.TLS, pParse uintptr, pSubq uintptr, pExpr ui // ** // ** NAME AMBIGUITY // ** -// ** This optimization is called the "WHERE-clause push-down optimization". +// ** This optimization is called the "WHERE-clause push-down optimization" +// ** or sometimes the "predicate push-down optimization". // ** // ** Do not confuse this optimization with another unrelated optimization // ** with a similar name: The "MySQL push-down optimization" causes WHERE @@ -122455,7 +123178,7 @@ func _pushDownWhereTerms(tls *libc.TLS, pParse uintptr, pSubq uintptr, pWhere ui var _ /* x at bp+0 */ TSubstContext _, _, _, _, _, _, _, _, _ = ii, nChng, notUnionAll, op, pColl, pList, pNew, pSel, pSrc /* The subquery FROM term into which WHERE is pushed */ nChng = 0 - pSrc = pSrcList + 8 + uintptr(iSrc)*104 + pSrc = pSrcList + 8 + uintptr(iSrc)*80 if pWhere == uintptr(0) { return 0 } @@ -122573,11 +123296,11 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) var v5 uint64 _, _, _, _, _, _, _, _, _, _, _, _, _ = colUsed, iCol, j, m, nChng, nCol, pList, pSub, pTab, pX, pY, v3, v5 /* Column number */ nChng = 0 /* Columns that may not be NULLed out */ - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x8>>3)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x100>>8)) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10>>4) != 0 || int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x200>>9) != 0 { return 0 } - pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab - pSub = (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect + pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab + pSub = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect pX = pSub for { if !(pX != 0) { @@ -122696,13 +123419,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15643) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15705) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15647) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15709) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -122740,10 +123463,10 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r func _isSimpleCount(tls *libc.TLS, p uintptr, pAggInfo uintptr) (r uintptr) { var pExpr, pTab uintptr _, _ = pExpr, pTab - if (*TSelect)(unsafe.Pointer(p)).FpWhere != 0 || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr != int32(1) || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc != int32(1) || (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect != 0 || (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc != int32(1) || (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpWhere != 0 || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr != int32(1) || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc != int32(1) || int32(*(*uint32)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + 24 + 4))&0x4>>2) != 0 || (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc != int32(1) || (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { return uintptr(0) } - pTab = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpTab + pTab = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) { return uintptr(0) } @@ -122777,8 +123500,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in defer tls.Free(32) var pIdx, pTab, zIndexedBy uintptr _, _, _ = pIdx, pTab, zIndexedBy - pTab = (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab - zIndexedBy = *(*uintptr)(unsafe.Pointer(pFrom + 88)) + pTab = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab + zIndexedBy = *(*uintptr)(unsafe.Pointer(pFrom + 48)) pIdx = (*TTable)(unsafe.Pointer(pTab)).FpIndex for { if !(pIdx != 0 && _sqlite3StrICmp(tls, (*TIndex)(unsafe.Pointer(pIdx)).FzName, zIndexedBy) != 0) { @@ -122790,11 +123513,11 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19711, libc.VaList(bp+8, zIndexedBy, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19796, libc.VaList(bp+8, zIndexedBy, 0)) (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) return int32(SQLITE_ERROR) } - *(*uintptr)(unsafe.Pointer(pFrom + 96)) = pIdx + *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx return SQLITE_OK } @@ -122881,7 +123604,8 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) } libc.Xmemset(tls, bp, 0, uint64(16)) pNewSrc = _sqlite3SrcListAppendFromTerm(tls, pParse, uintptr(0), uintptr(0), uintptr(0), bp, pNew, uintptr(0)) - if pNewSrc == uintptr(0) { + if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { + _sqlite3SrcListDelete(tls, db, pNewSrc) return int32(WRC_Abort) } *(*TSelect)(unsafe.Pointer(pNew)) = *(*TSelect)(unsafe.Pointer(p)) @@ -122913,8 +123637,8 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x4>>2)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19729, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19814, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -123021,10 +123745,10 @@ func _sqlite3WithPush(tls *libc.TLS, pParse uintptr, pWith uintptr, bFree Tu8) ( func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var bMayRecursive, i, iRecTab, rc, v4 int32 - var db, pCte, pCteUse, pEList, pItem, pLeft, pRecTerm, pSavedWith, pSel, pSrc, pTab, v1, v2, v5 uintptr + var bMayRecursive, i, iRecTab, rc, v3 int32 + var db, pCte, pCteUse, pEList, pItem, pLeft, pRecTerm, pSavedWith, pSel, pSrc, pTab, v1, v4 uintptr var _ /* pWith at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bMayRecursive, db, i, iRecTab, pCte, pCteUse, pEList, pItem, pLeft, pRecTerm, pSavedWith, pSel, pSrc, pTab, rc, v1, v2, v4, v5 /* The matching WITH */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bMayRecursive, db, i, iRecTab, pCte, pCteUse, pEList, pItem, pLeft, pRecTerm, pSavedWith, pSel, pSrc, pTab, rc, v1, v3, v4 /* The matching WITH */ if (*TParse)(unsafe.Pointer(pParse)).FpWith == uintptr(0) { /* There are no WITH clauses in the stack. No match is possible */ return 0 @@ -123034,12 +123758,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom ** go no further. */ return 0 } - if (*TSrcItem)(unsafe.Pointer(pFrom)).FzDatabase != uintptr(0) { + if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pFrom + 72)) != uintptr(0) { /* The FROM term contains a schema qualifier (ex: main.t1) and so ** it cannot possibly be a CTE reference. */ return 0 } - if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x200>>9)) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x400>>10) != 0 { /* The FROM term is specifically excluded from matching a CTE. ** (1) It is part of a trigger that used to have zDatabase but had ** zDatabase removed by sqlite3FixTriggerStep(). @@ -123077,28 +123801,27 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } (*TCteUse)(unsafe.Pointer(pCteUse)).FeM10d = (*TCte)(unsafe.Pointer(pCte)).FeM10d } - (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab = pTab + (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = pTab (*TTable)(unsafe.Pointer(pTab)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, db, (*TCte)(unsafe.Pointer(pCte)).FzName) (*TTable)(unsafe.Pointer(pTab)).FiPKey = int16(-int32(1)) (*TTable)(unsafe.Pointer(pTab)).FnRowLogEst = int16(200) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_Ephemeral) | libc.Int32FromInt32(TF_NoVisibleRowid)) - (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect = _sqlite3SelectDup(tls, db, (*TCte)(unsafe.Pointer(pCte)).FpSelect, 0) + _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*TCte)(unsafe.Pointer(pCte)).FpSelect, int32(1)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(2) } - *(*Tu32)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect + 4)) |= uint32(SF_CopyCte) - if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x2>>1)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19752, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 88)))) + pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect + *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) + if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19837, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } - libc.SetBitFieldPtr16Uint32(pFrom+60+4, libc.Uint32FromInt32(1), 8, 0x100) - *(*uintptr)(unsafe.Pointer(pFrom + 96)) = pCteUse + libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) + *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pCteUse (*TCteUse)(unsafe.Pointer(pCteUse)).FnUse++ /* Check if this is a recursive CTE. */ - v2 = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect - pSel = v2 - pRecTerm = v2 + pRecTerm = pSel bMayRecursive = libc.BoolInt32(libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pSel)).Fop) == int32(TK_ALL) || libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pSel)).Fop) == int32(TK_UNION)) for bMayRecursive != 0 && libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pRecTerm)).Fop) == libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pSel)).Fop) { pSrc = (*TSelect)(unsafe.Pointer(pRecTerm)).FpSrc @@ -123107,26 +123830,26 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if !(i < (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) { break } - pItem = pSrc + 8 + uintptr(i)*104 - if (*TSrcItem)(unsafe.Pointer(pItem)).FzDatabase == uintptr(0) && (*TSrcItem)(unsafe.Pointer(pItem)).FzName != uintptr(0) && 0 == _sqlite3StrICmp(tls, (*TSrcItem)(unsafe.Pointer(pItem)).FzName, (*TCte)(unsafe.Pointer(pCte)).FzName) { - (*TSrcItem)(unsafe.Pointer(pItem)).FpTab = pTab + pItem = pSrc + 8 + uintptr(i)*80 + if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != uintptr(0) && !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x20000>>17) != 0) && !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0) && (int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) != 0 || *(*uintptr)(unsafe.Pointer(pItem + 72)) == uintptr(0)) && 0 == _sqlite3StrICmp(tls, (*TSrcItem)(unsafe.Pointer(pItem)).FzName, (*TCte)(unsafe.Pointer(pCte)).FzName) { + (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = pTab (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - libc.SetBitFieldPtr16Uint32(pItem+60+4, libc.Uint32FromInt32(1), 6, 0x40) + libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19772, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19857, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v5 = pParse + 52 - v4 = *(*int32)(unsafe.Pointer(v5)) - *(*int32)(unsafe.Pointer(v5))++ - iRecTab = v4 + v4 = pParse + 56 + v3 = *(*int32)(unsafe.Pointer(v4)) + *(*int32)(unsafe.Pointer(v4))++ + iRecTab = v3 } (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = iRecTab } - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -123135,7 +123858,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19815 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19900 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -123158,15 +123881,15 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if !((*TSelect)(unsafe.Pointer(pLeft)).FpPrior != 0) { break } - goto _6 - _6: + goto _5 + _5: ; pLeft = (*TSelect)(unsafe.Pointer(pLeft)).FpPrior } pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19838, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19923, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -123175,9 +123898,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19876 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19961 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19910 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19995 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -123225,10 +123948,10 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var pSel, pTab, v1 uintptr var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 - pSel = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect + pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) pTab = v1 - (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab = v1 + (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -123236,7 +123959,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+19948, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20033, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -123269,14 +123992,14 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int func _inAnyUsingClause(tls *libc.TLS, zName uintptr, pBase uintptr, N int32) (r int32) { for N > 0 { N-- - pBase += 104 - if int32(uint32(*(*uint16)(unsafe.Pointer(pBase + 60 + 4))&0x400>>10)) == 0 { + pBase += 80 + if int32(*(*uint32)(unsafe.Pointer(pBase + 24 + 4))&0x800>>11) == 0 { continue } - if *(*uintptr)(unsafe.Pointer(pBase + 72)) == uintptr(0) { + if *(*uintptr)(unsafe.Pointer(pBase + 64)) == uintptr(0) { continue } - if _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pBase + 72)), zName) >= 0 { + if _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pBase + 64)), zName) >= 0 { return int32(1) } } @@ -123363,11 +124086,11 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if !(i < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) { break } - if (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab != 0 { + if (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab != 0 { goto _3 } if (*TSrcItem)(unsafe.Pointer(pFrom)).FzName == uintptr(0) { - pSel = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect + pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect /* A sub-query in the FROM clause of a SELECT */ if _sqlite3WalkSelect(tls, pWalker, pSel) != 0 { return int32(WRC_Abort) @@ -123382,18 +124105,18 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if rc > int32(1) { return int32(WRC_Abort) } - pTab = (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab + pTab = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab } else { /* An ordinary table or view name in the FROM clause */ v5 = _sqlite3LocateTableItem(tls, pParse, uint32(0), pFrom) pTab = v5 - (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab = v5 + (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v5 if pTab == uintptr(0) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19952, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) - (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab = uintptr(0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20037, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ @@ -123407,13 +124130,13 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19991, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20076, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } - (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect = _sqlite3SelectDup(tls, db, (*(*struct { + _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr - })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, 0) + })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, int32(1)) } else { - if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) && int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x80>>7)) != 0 && (*(*struct { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) && int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x100>>8) != 0 && (*(*struct { FnArg int32 FazArg uintptr Fp uintptr @@ -123422,27 +124145,29 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15202, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol (*TTable)(unsafe.Pointer(pTab)).FnCol = int16(-int32(1)) (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) /* Turn on Select.selId renumbering */ - _sqlite3WalkSelect(tls, pWalker, (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect) + if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x4>>2) != 0 { + _sqlite3WalkSelect(tls, pWalker, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect) + } (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(eCodeOrig) (*TTable)(unsafe.Pointer(pTab)).FnCol = nCol } } } /* Locate the index named by the INDEXED BY clause, if any. */ - if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x2>>1)) != 0 && _sqlite3IndexedByLookup(tls, pParse, pFrom) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 && _sqlite3IndexedByLookup(tls, pParse, pFrom) != 0 { return int32(WRC_Abort) } goto _3 _3: ; i++ - pFrom += 104 + pFrom += 80 } /* Process NATURAL keywords, and ON and USING clauses of joins. */ @@ -123523,8 +124248,8 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if !(i < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) { break } /* Number of cols including rowid */ - pTab1 = (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab /* AS name for this data source */ - zSchemaName = uintptr(0) /* USING clause for pFrom[1] */ + pTab1 = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab /* AS name for this data source */ + zSchemaName = uintptr(0) /* USING clause for pFrom[1] */ v9 = (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias zTabName = v9 if v9 == uintptr(0) { @@ -123533,8 +124258,8 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { break } - if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x2000>>13)) != 0 { - pNestedFrom = (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect)).FpEList + if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x4000>>14) != 0 { + pNestedFrom = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect)).FpEList } else { if zTName != 0 && _sqlite3StrICmp(tls, zTName, zTabName) != 0 { goto _8 @@ -123544,24 +124269,24 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 6654 + v10 = __ccgo_ts + 6716 } zSchemaName = v10 } - if i+int32(1) < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc && int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 1*104 + 60 + 4))&0x400>>10)) != 0 && libc.Int32FromUint16(selFlags)&int32(SF_NestedFrom) != 0 { - pUsing = *(*uintptr)(unsafe.Pointer(pFrom + 1*104 + 72)) + if i+int32(1) < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc && int32(*(*uint32)(unsafe.Pointer(pFrom + 1*80 + 24 + 4))&0x800>>11) != 0 && libc.Int32FromUint16(selFlags)&int32(SF_NestedFrom) != 0 { + pUsing = *(*uintptr)(unsafe.Pointer(pFrom + 1*80 + 64)) ii = 0 for { if !(ii < (*TIdList)(unsafe.Pointer(pUsing)).FnId) { break } - zUName = (*(*TIdList_item)(unsafe.Pointer(pUsing + 8 + uintptr(ii)*16))).FzName + zUName = (*(*TIdList_item)(unsafe.Pointer(pUsing + 8 + uintptr(ii)*8))).FzName pRight = _sqlite3Expr(tls, db, int32(TK_ID), zUName) _sqlite3ExprSetErrorOffset(tls, pRight, iErrOfst) pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20022, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20107, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -123610,7 +124335,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } tableSeen = int32(1) if i > 0 && zTName == uintptr(0) && libc.Int32FromUint16(selFlags)&int32(SF_NestedFrom) == 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x400>>10)) != 0 && _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pFrom + 72)), zName) >= 0 { + if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x800>>11) != 0 && _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pFrom + 64)), zName) >= 0 { /* In a join with a USING clause, omit columns in the ** using clause from the table on the right. */ goto _12 @@ -123640,7 +124365,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20027, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20112, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -123648,12 +124373,12 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { v13 = int32(ENAME_TAB) } libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(v13), 0, 0x3) - if int32(uint32(*(*uint16)(unsafe.Pointer(pFrom + 60 + 4))&0x400>>10)) != 0 && _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pFrom + 72)), zName) >= 0 || pUsing != 0 && _sqlite3IdListIndex(tls, pUsing, zName) >= 0 || j < int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_NOEXPAND) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x800>>11) != 0 && _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pFrom + 64)), zName) >= 0 || pUsing != 0 && _sqlite3IdListIndex(tls, pUsing, zName) >= 0 || j < int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab1)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_NOEXPAND) != 0 { libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(1), 8, 0x100) } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12506, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -123669,13 +124394,13 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { _8: ; i++ - pFrom += 104 + pFrom += 80 } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20036, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20121, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20054, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20139, 0) } } } @@ -123689,7 +124414,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20074, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20159, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -123762,19 +124487,17 @@ func _selectAddSubqueryTypeInfo(tls *libc.TLS, pWalker uintptr, p uintptr) { if !(i < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) { break } - pTab = (*TSrcItem)(unsafe.Pointer(pFrom)).FpTab - if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Ephemeral) != uint32(0) { + pTab = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab + if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Ephemeral) != uint32(0) && int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x4>>2) != 0 { /* A sub-query in the FROM clause of a SELECT */ - pSel = (*TSrcItem)(unsafe.Pointer(pFrom)).FpSelect - if pSel != 0 { - _sqlite3SubqueryColumnTypes(tls, pParse, pTab, pSel, uint8(SQLITE_AFF_NONE)) - } + pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect + _sqlite3SubqueryColumnTypes(tls, pParse, pTab, pSel, uint8(SQLITE_AFF_NONE)) } goto _1 _1: ; i++ - pFrom += 104 + pFrom += 80 } } @@ -123993,7 +124716,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -124030,12 +124753,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20105, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20190, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20156, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20241, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -124056,7 +124779,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20189, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20274, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -124083,6 +124806,9 @@ func _finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { break } + if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { + return + } pList = *(*uintptr)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pF)).FpFExpr + 32)) if (*TAggInfo_func)(unsafe.Pointer(pF)).FiOBTab >= 0 { /* Loop counter */ nArg = (*TExprList)(unsafe.Pointer(pList)).FnExpr @@ -124126,7 +124852,7 @@ func _finalizeAggFunctions(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { } _sqlite3VdbeAddOp3(tls, v, int32(OP_AggStep), 0, regAgg, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+(*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn+i) _sqlite3VdbeAppendP4(tls, v, (*TAggInfo_func)(unsafe.Pointer(pF)).FpFunc, -int32(7)) - _sqlite3VdbeChangeP5(tls, v, uint16(libc.Uint8FromInt32(nArg))) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(nArg)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), (*TAggInfo_func)(unsafe.Pointer(pF)).FiOBTab, iTop+int32(1)) _sqlite3VdbeJumpHere(tls, v, iTop) _sqlite3ReleaseTempRange(tls, pParse, regAgg, nArg) @@ -124192,7 +124918,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 56 + v3 = pParse + 60 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -124300,7 +125026,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 56 + v8 = pParse + 60 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -124309,12 +125035,15 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui } _sqlite3VdbeAddOp3(tls, v, int32(OP_AggStep), 0, regAgg, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+(*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn+i) _sqlite3VdbeAppendP4(tls, v, (*TAggInfo_func)(unsafe.Pointer(pF)).FpFunc, -int32(7)) - _sqlite3VdbeChangeP5(tls, v, uint16(libc.Uint8FromInt32(nArg))) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(nArg)) _sqlite3ReleaseTempRange(tls, pParse, regAgg, nArg) } if addrNext != 0 { _sqlite3VdbeResolveLabel(tls, v, addrNext) } + if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { + return + } goto _1 _1: ; @@ -124334,6 +125063,9 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui break } _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pC)).FpCExpr, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+i) + if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { + return + } goto _9 _9: ; @@ -124361,16 +125093,16 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20222 + v1 = __ccgo_ts + 20307 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } if bCover != 0 { v2 = (*TIndex)(unsafe.Pointer(pIdx)).FzName } else { - v2 = __ccgo_ts + 1662 + v2 = __ccgo_ts + 1663 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20245, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20330, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -124402,7 +125134,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8255) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8317) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -124457,38 +125189,39 @@ func _havingToWhere(tls *libc.TLS, pParse uintptr, p uintptr) { // ** instance of that view found. If pThis is not a self-join then return 0. // */ func _isSelfJoinView(tls *libc.TLS, pTabList uintptr, pThis uintptr, iFirst int32, iEnd int32) (r uintptr) { - var pItem, pS1 uintptr + var pItem, pS1, pSel uintptr var v1 int32 - _, _, _ = pItem, pS1, v1 - if (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselFlags&uint32(SF_PushDown) != 0 { + _, _, _, _ = pItem, pS1, pSel, v1 + pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pThis + 72)))).FpSelect + if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_PushDown) != 0 { return uintptr(0) } for iFirst < iEnd { v1 = iFirst iFirst++ - pItem = pTabList + 8 + uintptr(v1)*104 - if (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect == uintptr(0) { + pItem = pTabList + 8 + uintptr(v1)*80 + if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0) { continue } - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x20>>5)) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x40>>6) != 0 { continue } if (*TSrcItem)(unsafe.Pointer(pItem)).FzName == uintptr(0) { continue } - if (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema != (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pThis)).FpTab)).FpSchema { + if (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FpSchema != (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pThis)).FpSTab)).FpSchema { continue } if Xsqlite3_stricmp(tls, (*TSrcItem)(unsafe.Pointer(pItem)).FzName, (*TSrcItem)(unsafe.Pointer(pThis)).FzName) != 0 { continue } - pS1 = (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect - if (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FpSchema == uintptr(0) && (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pThis)).FpSelect)).FselId != (*TSelect)(unsafe.Pointer(pS1)).FselId { + pS1 = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect + if (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FpSchema == uintptr(0) && (*TSelect)(unsafe.Pointer(pSel)).FselId != (*TSelect)(unsafe.Pointer(pS1)).FselId { /* The query flattener left two different CTE tables with identical ** names in the same FROM clause. */ continue } - if (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FselFlags&uint32(SF_PushDown) != 0 { + if (*TSelect)(unsafe.Pointer(pS1)).FselFlags&uint32(SF_PushDown) != 0 { /* The view was modified by some other optimization such as ** pushDownWhereTerms() */ continue @@ -124534,8 +125267,8 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** Return TRUE if the optimization is undertaken. // */ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { - var db, pCount, pExpr, pPrior, pSub, pTerm, v1 uintptr - _, _, _, _, _, _, _ = db, pCount, pExpr, pPrior, pSub, pTerm, v1 + var db, pCount, pExpr, pFrom, pPrior, pSub, pTerm, v1 uintptr + _, _, _, _, _, _, _, _ = db, pCount, pExpr, pFrom, pPrior, pSub, pTerm, v1 if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { return 0 } /* This is an aggregate */ @@ -124558,7 +125291,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+15937) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+15999) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -124570,10 +125303,11 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return 0 } /* Not a window function */ - pSub = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect - if pSub == uintptr(0) { + pFrom = (*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x4>>2) == 0 { return 0 - } /* The FROM is a subquery */ + } /* FROM is a subquery */ + pSub = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSub)).FpPrior == uintptr(0) { return 0 } /* Must be a compound */ @@ -124600,10 +125334,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 db = (*TParse)(unsafe.Pointer(pParse)).Fdb pCount = pExpr pExpr = uintptr(0) - pSub = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect - (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect = uintptr(0) + pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(112)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) @@ -124649,14 +125382,14 @@ func _sameSrcAlias(tls *libc.TLS, p0 uintptr, pSrc uintptr) (r int32) { if !(i < (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) { break } - p1 = pSrc + 8 + uintptr(i)*104 + p1 = pSrc + 8 + uintptr(i)*80 if p1 == p0 { goto _1 } - if (*TSrcItem)(unsafe.Pointer(p0)).FpTab == (*TSrcItem)(unsafe.Pointer(p1)).FpTab && 0 == Xsqlite3_stricmp(tls, (*TSrcItem)(unsafe.Pointer(p0)).FzAlias, (*TSrcItem)(unsafe.Pointer(p1)).FzAlias) { + if (*TSrcItem)(unsafe.Pointer(p0)).FpSTab == (*TSrcItem)(unsafe.Pointer(p1)).FpSTab && 0 == Xsqlite3_stricmp(tls, (*TSrcItem)(unsafe.Pointer(p0)).FzAlias, (*TSrcItem)(unsafe.Pointer(p1)).FzAlias) { return int32(1) } - if (*TSrcItem)(unsafe.Pointer(p1)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p1)).FpSelect)).FselFlags&uint32(SF_NestedFrom) != uint32(0) && _sameSrcAlias(tls, p0, (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p1)).FpSelect)).FpSrc) != 0 { + if int32(*(*uint32)(unsafe.Pointer(p1 + 24 + 4))&0x4>>2) != 0 && (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p1 + 72)))).FpSelect)).FselFlags&uint32(SF_NestedFrom) != uint32(0) && _sameSrcAlias(tls, p0, (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p1 + 72)))).FpSelect)).FpSrc) != 0 { return int32(1) } goto _1 @@ -124700,9 +125433,9 @@ func _sameSrcAlias(tls *libc.TLS, p0 uintptr, pSrc uintptr) (r int32) { func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintptr, i int32, selFlags int32) (r int32) { var pCteUse, pItem uintptr _, _ = pCteUse, pItem - pItem = pTabList + 8 + uintptr(i)*104 - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x100>>8)) != 0 { - pCteUse = *(*uintptr)(unsafe.Pointer(pItem + 96)) + pItem = pTabList + 8 + uintptr(i)*80 + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x200>>9) != 0 { + pCteUse = *(*uintptr)(unsafe.Pointer(pItem + 56)) if libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(pCteUse)).FeM10d) == M10d_Yes { return 0 } /* (2a) */ @@ -124723,7 +125456,7 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc == int32(1) { return int32(1) } /* (1a) */ - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + 1*104))).Ffg.Fjointype)&int32(JT_CROSS) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + 1*80))).Ffg.Fjointype)&int32(JT_CROSS) != 0 { return int32(1) } /* (1b) */ if selFlags&int32(SF_UpdateFrom) != 0 { @@ -124742,8 +125475,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp break } i-- - pItem -= 104 - if (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect != uintptr(0) { + pItem -= 80 + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { return 0 } /* (1c-i) */ } @@ -124753,7 +125486,7 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp // C documentation // // /* -// ** Generate code for the SELECT statement given in the p argument. +// ** Generate byte-code for the SELECT statement given in the p argument. // ** // ** The results are returned according to the SelectDest structure. // ** See comments in sqliteInt.h for further information. @@ -124764,12 +125497,46 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp // ** // ** This routine does NOT free the Select structure passed in. The // ** calling function needs to do that. +// ** +// ** This is a long function. The following is an outline of the processing +// ** steps, with tags referencing various milestones: +// ** +// ** * Resolve names and similar preparation tag-select-0100 +// ** * Scan of the FROM clause tag-select-0200 +// ** + OUTER JOIN strength reduction tag-select-0220 +// ** + Sub-query ORDER BY removal tag-select-0230 +// ** + Query flattening tag-select-0240 +// ** * Separate subroutine for compound-SELECT tag-select-0300 +// ** * WHERE-clause constant propagation tag-select-0330 +// ** * Count()-of-VIEW optimization tag-select-0350 +// ** * Scan of the FROM clause again tag-select-0400 +// ** + Authorize unreferenced tables tag-select-0410 +// ** + Predicate push-down optimization tag-select-0420 +// ** + Omit unused subquery columns optimization tag-select-0440 +// ** + Generate code to implement subqueries tag-select-0480 +// ** - Co-routines tag-select-0482 +// ** - Reuse previously computed CTE tag-select-0484 +// ** - REuse previously computed VIEW tag-select-0486 +// ** - Materialize a VIEW or CTE tag-select-0488 +// ** * DISTINCT ORDER BY -> GROUP BY optimization tag-select-0500 +// ** * Set up for ORDER BY tag-select-0600 +// ** * Create output table tag-select-0630 +// ** * Prepare registers for LIMIT tag-select-0650 +// ** * Setup for DISTINCT tag-select-0680 +// ** * Generate code for non-aggregate and non-GROUP BY tag-select-0700 +// ** * Generate code for aggregate and/or GROUP BY tag-select-0800 +// ** + GROUP BY queries tag-select-0810 +// ** + non-GROUP BY queries tag-select-0820 +// ** - Special case of count() w/o GROUP BY tag-select-0821 +// ** - General case of non-GROUP BY aggregates tag-select-0822 +// ** * Sort results, as needed tag-select-0900 +// ** * Internal self-checks tag-select-1000 // */ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iEnd, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v11, v14, v17, v22, v24, v25, v30, v31, v32, v34, v36, v38, v40, v42, v43, v47, v48, v52, v56, v58 int32 - var db, p0, pAggInfo, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pSub, pSub1, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, v, zSavedAuthContext, v1, v12, v13, v15, v16, v18, v23, v26, v33, v35, v37, v39, v41, v44, v49, v51, v53, v57, p21, p3, p4, p6, p7, p9 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -124778,11 +125545,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iEnd, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pSub, pSub1, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zSavedAuthContext, v1, v11, v12, v13, v14, v15, v16, v17, v18, v22, v23, v24, v25, v26, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v47, v48, v49, v51, v52, v53, v56, v57, v58, p21, p3, p4, p6, p7, p9 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -124791,6 +125558,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_SELECT), uintptr(0), uintptr(0), uintptr(0)) != 0 { return int32(1) } + /* tag-select-0100 */ if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) { /* All of these destinations are also able to ignore the ORDER BY clause */ if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != 0 { @@ -124819,9 +125587,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if (*TSrcItem)(unsafe.Pointer(p0)).FzAlias != 0 { v1 = (*TSrcItem)(unsafe.Pointer(p0)).FzAlias } else { - v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpTab)).FzName + v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20257, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20342, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, @@ -124842,15 +125610,21 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy = (*TSelect)(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 + ** tag-select-0200 */ i = 0 for { if !(!((*TSelect)(unsafe.Pointer(p)).FpPrior != 0) && i < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) { break } - pItem = pTabList + 8 + uintptr(i)*104 - pSub = (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect - pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab + pItem = pTabList + 8 + uintptr(i)*80 + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { + v3 = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect + } else { + v3 = uintptr(0) + } + pSub = v3 + pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab /* The expander should have already created transient Table objects ** even for FROM clause elements such as subqueries that do not correspond ** to a real table */ @@ -124864,15 +125638,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** way that the i-th table cannot be the NULL row of a join, then ** perform the appropriate simplification. This is called ** "OUTER JOIN strength reduction" in the SQLite documentation. + ** tag-select-0220 */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0 && _sqlite3ExprImpliesNonNullRow(tls, (*TSelect)(unsafe.Pointer(p)).FpWhere, (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor, libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LTORJ)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_SimplifyJoin)) == uint32(0) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { - p3 = pItem + 60 - *(*Tu8)(unsafe.Pointer(p3)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p3))) & ^libc.Int32FromInt32(JT_LEFT)) + p4 = pItem + 24 + *(*Tu8)(unsafe.Pointer(p4)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p4))) & ^libc.Int32FromInt32(JT_LEFT)) } else { - p4 = pItem + 60 - *(*Tu8)(unsafe.Pointer(p4)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p4))) & ^(libc.Int32FromInt32(JT_LEFT) | libc.Int32FromInt32(JT_OUTER))) + p5 = pItem + 24 + *(*Tu8)(unsafe.Pointer(p5)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p5))) & ^(libc.Int32FromInt32(JT_LEFT) | libc.Int32FromInt32(JT_OUTER))) _unsetJoinExpr(tls, (*TSelect)(unsafe.Pointer(p)).FpWhere, (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor, 0) } } @@ -124882,19 +125657,19 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(j < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) { break } - pI2 = pTabList + 8 + uintptr(j)*104 + pI2 = pTabList + 8 + uintptr(j)*80 if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pI2)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pI2)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - p6 = pI2 + 60 - *(*Tu8)(unsafe.Pointer(p6)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p6))) & ^libc.Int32FromInt32(JT_RIGHT)) + p7 = pI2 + 24 + *(*Tu8)(unsafe.Pointer(p7)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p7))) & ^libc.Int32FromInt32(JT_RIGHT)) } else { - p7 = pI2 + 60 - *(*Tu8)(unsafe.Pointer(p7)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p7))) & ^(libc.Int32FromInt32(JT_RIGHT) | libc.Int32FromInt32(JT_OUTER))) + p8 = pI2 + 24 + *(*Tu8)(unsafe.Pointer(p8)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p8))) & ^(libc.Int32FromInt32(JT_RIGHT) | libc.Int32FromInt32(JT_OUTER))) _unsetJoinExpr(tls, (*TSelect)(unsafe.Pointer(p)).FpWhere, (*TSrcItem)(unsafe.Pointer(pI2)).FiCursor, int32(1)) } } - goto _5 - _5: + goto _6 + _6: ; j++ } @@ -124903,13 +125678,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(j >= 0) { break } - p9 = pTabList + 8 + uintptr(j)*104 + 60 - *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^libc.Int32FromInt32(JT_LTORJ)) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*104))).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + p10 = pTabList + 8 + uintptr(j)*80 + 24 + *(*Tu8)(unsafe.Pointer(p10)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p10))) & ^libc.Int32FromInt32(JT_LTORJ)) + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(j)*80))).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { break } - goto _8 - _8: + goto _9 + _9: ; j-- } @@ -124922,14 +125697,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20311, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20396, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY ** elimination) on a MATERIALIZED common table expression because ** a MATERIALIZED common table expression is an optimization fence. */ - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x100>>8)) != 0 && libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 96)))).FeM10d) == M10d_Yes { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x200>>9) != 0 && libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 56)))).FeM10d) == M10d_Yes { goto _2 } /* Do not try to flatten an aggregate subquery. @@ -124942,7 +125717,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != uint32(0) { goto _2 } - /* If a FROM-clause subquery has an ORDER BY clause that is not + /* tag-select-0230: + ** If a FROM-clause subquery has an ORDER BY clause that is not ** really doing anything, then delete it now so that it does not ** interfere with query flattening. See the discussion at ** https://sqlite.org/forum/forumpost/2d76f2bcf65d256a @@ -124961,10 +125737,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** (a) The outer query has a different ORDER BY clause ** (b) The subquery is part of a join ** See forum post 062d576715d277c8 + ** (6) The subquery is not a recursive CTE. ORDER BY has a different + ** meaning for recursive CTEs and this optimization does not + ** apply. ** ** Also retain the ORDER BY if the OmitOrderBy optimization is disabled. */ - if (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) && ((*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) || (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(1)) && (*TSelect)(unsafe.Pointer(pSub)).FpLimit == uintptr(0) && (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_OrderByReqd) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_OrderByReqd) == uint32(0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OmitOrderBy)) == uint32(0) { + if (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) && ((*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) || (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(1)) && (*TSelect)(unsafe.Pointer(pSub)).FpLimit == uintptr(0) && (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_OrderByReqd)|libc.Int32FromInt32(SF_Recursive)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_OrderByReqd) == uint32(0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OmitOrderBy)) == uint32(0) { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy) (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy = uintptr(0) } @@ -124986,9 +125765,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** ** SELECT x FROM (SELECT x FROM tab ORDER BY y LIMIT 10); */ - if (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) && i == 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_ComplexResult) != uint32(0) && ((*TSrcList)(unsafe.Pointer(pTabList)).FnSrc == int32(1) || libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + 1*104))).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)) != 0) { + if (*TSelect)(unsafe.Pointer(pSub)).FpOrderBy != uintptr(0) && i == 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_ComplexResult) != uint32(0) && ((*TSrcList)(unsafe.Pointer(pTabList)).FnSrc == int32(1) || libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + 1*80))).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)) != 0) { goto _2 } + /* tag-select-0240 */ if _flattenSubquery(tls, pParse, p, i, isAgg) != 0 { if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto select_end @@ -125009,7 +125789,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r i++ } /* Handle compound SELECT statements using the separate multiSelect() - ** procedure. + ** procedure. tag-select-0300 */ if (*TSelect)(unsafe.Pointer(p)).FpPrior != 0 { rc = _multiSelect(tls, pParse, p, pDest) @@ -125019,30 +125799,36 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r return rc } /* Do the WHERE-clause constant propagation optimization if this is - ** a join. No need to speed time on this operation for non-join queries + ** a join. No need to spend time on this operation for non-join queries ** as the equivalent optimization will be handled by query planner in - ** sqlite3WhereBegin(). + ** sqlite3WhereBegin(). tag-select-0330 */ if (*TSelect)(unsafe.Pointer(p)).FpWhere != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpWhere)).Fop) == int32(TK_AND) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_PropagateConst)) == uint32(0) && _propagateConstants(tls, pParse, p) != 0 { } else { } + /* tag-select-0350 */ if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_QueryFlattener)|libc.Int32FromInt32(SQLITE_CountOfView)) == uint32(0) && _countOfViewOptimization(tls, pParse, p) != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto select_end } pTabList = (*TSelect)(unsafe.Pointer(p)).FpSrc } - /* For each term in the FROM clause, do two things: - ** (1) Authorized unreferenced tables - ** (2) Generate code for all sub-queries + /* Loop over all terms in the FROM clause and do two things for each term: + ** + ** (1) Authorize unreferenced tables + ** (2) Generate code for all sub-queries + ** + ** tag-select-0400 */ i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc) { break } - pItem1 = pTabList + 8 + uintptr(i)*104 - /* Issue SQLITE_READ authorizations with a fake column name for any + pItem1 = pTabList + 8 + uintptr(i)*80 + /* Authorized unreferenced tables. tag-select-0410 + ** + ** Issue SQLITE_READ authorizations with a fake column name for any ** tables that are referenced but from which no values are extracted. ** Examples of where these kinds of null SQLITE_READ authorizations ** would occur: @@ -125059,15 +125845,29 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** string for the fake column name seems safer. */ if (*TSrcItem)(unsafe.Pointer(pItem1)).FcolUsed == uint64(0) && (*TSrcItem)(unsafe.Pointer(pItem1)).FzName != uintptr(0) { - _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1662, (*TSrcItem)(unsafe.Pointer(pItem1)).FzDatabase) + if int32(*(*uint32)(unsafe.Pointer(pItem1 + 24 + 4))&0x10000>>16) != 0 { + iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pItem1 + 72))) + zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName + } else { + if int32(*(*uint32)(unsafe.Pointer(pItem1 + 24 + 4))&0x4>>2) != 0 { + zDb = uintptr(0) + } else { + zDb = *(*uintptr)(unsafe.Pointer(pItem1 + 72)) + } + } + _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1663, zDb) } /* Generate code for all sub-queries in the FROM clause */ - pSub1 = (*TSrcItem)(unsafe.Pointer(pItem1)).FpSelect - if pSub1 == uintptr(0) || (*TSrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub != 0 { - goto _10 + if int32(*(*uint32)(unsafe.Pointer(pItem1 + 24 + 4))&0x4>>2) == 0 { + goto _11 } + pSubq = *(*uintptr)(unsafe.Pointer(pItem1 + 72)) + pSub1 = (*TSubquery)(unsafe.Pointer(pSubq)).FpSelect /* The code for a subquery should only be generated once. */ + if (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub != 0 { + goto _11 + } /* Increment Parse.nHeight by the height of the largest expression ** tree referred to by this, the parent select. The child select ** may contain expression trees of at most @@ -125078,72 +125878,73 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r *(*int32)(unsafe.Pointer(pParse + 316)) += _sqlite3SelectExprHeight(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. + ** This is the "predicate push-down optimization". tag-select-0420 */ - if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_PushDown)) == uint32(0) && (int32(uint32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x100>>8)) == 0 || libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 96)))).FeM10d) != M10d_Yes && (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 96)))).FnUse < int32(2)) && _pushDownWhereTerms(tls, pParse, pSub1, (*TSelect)(unsafe.Pointer(p)).FpWhere, pTabList, i) != 0 { + if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_PushDown)) == uint32(0) && (int32(*(*uint32)(unsafe.Pointer(pItem1 + 24 + 4))&0x200>>9) == 0 || libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 56)))).FeM10d) != M10d_Yes && (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 56)))).FnUse < int32(2)) && _pushDownWhereTerms(tls, pParse, pSub1, (*TSelect)(unsafe.Pointer(p)).FpWhere, pTabList, i) != 0 { } else { } /* Convert unused result columns of the subquery into simple NULL ** expressions, to avoid unneeded searching and computation. + ** tag-select-0440 */ if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_NullUnusedCols)) == uint32(0) && _disableUnusedSubqueryResultColumns(tls, pItem1) != 0 { } zSavedAuthContext = (*TParse)(unsafe.Pointer(pParse)).FzAuthContext (*TParse)(unsafe.Pointer(pParse)).FzAuthContext = (*TSrcItem)(unsafe.Pointer(pItem1)).FzName - /* Generate code to implement the subquery + /* Generate byte-code to implement the subquery tag-select-0480 */ if _fromClauseTermCanBeCoroutine(tls, pParse, pTabList, i, libc.Int32FromUint32((*TSelect)(unsafe.Pointer(p)).FselFlags)) != 0 { /* Implement a co-routine that will return a single row of the result - ** set on each invocation. + ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v12 = pParse + 56 - *(*int32)(unsafe.Pointer(v12))++ - v11 = *(*int32)(unsafe.Pointer(v12)) - (*TSrcItem)(unsafe.Pointer(pItem1)).FregReturn = v11 - _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSrcItem)(unsafe.Pointer(pItem1)).FregReturn, 0, addrTop) - (*TSrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = addrTop - _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSrcItem)(unsafe.Pointer(pItem1)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20351, libc.VaList(bp+176, pItem1)) + v13 = pParse + 60 + *(*int32)(unsafe.Pointer(v13))++ + v12 = *(*int32)(unsafe.Pointer(v13)) + (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 + _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) + (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop + _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20436, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) - (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow - libc.SetBitFieldPtr16Uint32(pItem1+60+4, libc.Uint32FromInt32(1), 5, 0x20) - (*TSrcItem)(unsafe.Pointer(pItem1)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp + 72))).FiSdst - _sqlite3VdbeEndCoroutine(tls, v, (*TSrcItem)(unsafe.Pointer(pItem1)).FregReturn) + (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow + libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) + (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp + 72))).FiSdst + _sqlite3VdbeEndCoroutine(tls, v, (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) _sqlite3VdbeJumpHere(tls, v, addrTop-int32(1)) _sqlite3ClearTempRegCache(tls, pParse) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x100>>8)) != 0 && (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 96)))).FaddrM9e > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem1 + 24 + 4))&0x200>>9) != 0 && (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem1 + 56)))).FaddrM9e > 0 { /* 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 ephemeral table that - ** holds the result of the materialization. */ - pCteUse = *(*uintptr)(unsafe.Pointer(pItem1 + 96)) + ** then make the pItem->iCursor be a copy of the ephemeral table that + ** holds the result of the materialization. tag-select-0484 */ + pCteUse = *(*uintptr)(unsafe.Pointer(pItem1 + 56)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TCteUse)(unsafe.Pointer(pCteUse)).FregRtn, (*TCteUse)(unsafe.Pointer(pCteUse)).FaddrM9e) if (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor != (*TCteUse)(unsafe.Pointer(pCteUse)).FiCur { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor, (*TCteUse)(unsafe.Pointer(pCteUse)).FiCur) } (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TCteUse)(unsafe.Pointer(pCteUse)).FnRowEst } else { - v13 = _isSelfJoinView(tls, pTabList, pItem1, 0, i) - pPrior = v13 - if v13 != uintptr(0) { - /* This view has already been materialized by a prior entry in - ** this same FROM clause. Reuse it. */ - if (*TSrcItem)(unsafe.Pointer(pPrior)).FaddrFillSub != 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSrcItem)(unsafe.Pointer(pPrior)).FregReturn, (*TSrcItem)(unsafe.Pointer(pPrior)).FaddrFillSub) + v14 = _isSelfJoinView(tls, pTabList, pItem1, 0, i) + pPrior = v14 + if v14 != uintptr(0) { + pPriorSubq = *(*uintptr)(unsafe.Pointer(pPrior + 72)) + if (*TSubquery)(unsafe.Pointer(pPriorSubq)).FaddrFillSub != 0 { + _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSubquery)(unsafe.Pointer(pPriorSubq)).FregReturn, (*TSubquery)(unsafe.Pointer(pPriorSubq)).FaddrFillSub) } _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor, (*TSrcItem)(unsafe.Pointer(pPrior)).FiCursor) - (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pPrior)).FpSelect)).FnSelectRow + (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v15 = pParse + 56 - *(*int32)(unsafe.Pointer(v15))++ - v14 = *(*int32)(unsafe.Pointer(v15)) - (*TSrcItem)(unsafe.Pointer(pItem1)).FregReturn = v14 + v16 = pParse + 60 + *(*int32)(unsafe.Pointer(v16))++ + v15 = *(*int32)(unsafe.Pointer(v16)) + (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 topAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) - (*TSrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub = topAddr + int32(1) - libc.SetBitFieldPtr16Uint32(pItem1+60+4, libc.Uint32FromInt32(1), 4, 0x10) - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x8>>3)) == 0 { + (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = topAddr + int32(1) + libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 5, 0x20) + if int32(*(*uint32)(unsafe.Pointer(pItem1 + 24 + 4))&0x10>>4) == 0 { /* 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. */ @@ -125151,19 +125952,19 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20366, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20451, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) - (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow + (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { _sqlite3VdbeJumpHere(tls, v, onceAddr) } - _sqlite3VdbeAddOp2(tls, v, int32(OP_Return), (*TSrcItem)(unsafe.Pointer(pItem1)).FregReturn, topAddr+int32(1)) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Return), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, topAddr+int32(1)) _sqlite3VdbeJumpHere(tls, v, topAddr) _sqlite3ClearTempRegCache(tls, pParse) - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x100>>8)) != 0 && int32(uint32(*(*uint16)(unsafe.Pointer(pItem1 + 60 + 4))&0x8>>3)) == 0 { - pCteUse1 = *(*uintptr)(unsafe.Pointer(pItem1 + 96)) - (*TCteUse)(unsafe.Pointer(pCteUse1)).FaddrM9e = (*TSrcItem)(unsafe.Pointer(pItem1)).FaddrFillSub - (*TCteUse)(unsafe.Pointer(pCteUse1)).FregRtn = (*TSrcItem)(unsafe.Pointer(pItem1)).FregReturn + if int32(*(*uint32)(unsafe.Pointer(pItem1 + 24 + 4))&0x200>>9) != 0 && int32(*(*uint32)(unsafe.Pointer(pItem1 + 24 + 4))&0x10>>4) == 0 { + pCteUse1 = *(*uintptr)(unsafe.Pointer(pItem1 + 56)) + (*TCteUse)(unsafe.Pointer(pCteUse1)).FaddrM9e = (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub + (*TCteUse)(unsafe.Pointer(pCteUse1)).FregRtn = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn (*TCteUse)(unsafe.Pointer(pCteUse1)).FiCur = (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor (*TCteUse)(unsafe.Pointer(pCteUse1)).FnRowEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow } @@ -125175,8 +125976,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } *(*int32)(unsafe.Pointer(pParse + 316)) -= _sqlite3SelectExprHeight(tls, p) (*TParse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext - goto _10 - _10: + goto _11 + _11: ; i++ } @@ -125187,7 +125988,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pGroupBy = (*TSelect)(unsafe.Pointer(p)).FpGroupBy pHaving = (*TSelect)(unsafe.Pointer(p)).FpHaving (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct = libc.BoolUint8((*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0)) - /* If the query is DISTINCT with an ORDER BY but is not an aggregate, and + /* tag-select-0500 + ** + ** 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 ** can be rewritten as a GROUP BY. In other words, this: ** @@ -125202,11 +126005,24 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** 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 (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { + if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) - v16 = _sqlite3ExprListDup(tls, db, pEList, 0) - (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v16 - pGroupBy = v16 + v17 = _sqlite3ExprListDup(tls, db, pEList, 0) + (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 + pGroupBy = v17 + if pGroupBy != 0 { + i = 0 + for { + if !(i < (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) { + break + } + *(*Tu16)(unsafe.Pointer(pGroupBy + 8 + uintptr(i)*32 + 24)) = libc.Uint16FromInt32(i + int32(1)) + goto _18 + _18: + ; + i++ + } + } *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Aggregate) /* Notice that even thought SF_Distinct has been cleared from p->selFlags, ** the sDistinct.isTnct is still set. Hence, isTnct represents the @@ -125219,19 +126035,20 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** If that is the case, then the OP_OpenEphemeral instruction will be ** changed to an OP_Noop once we figure out that the sorting index is ** not needed. The sSort.addrSortIndex variable is used to facilitate - ** that change. + ** that change. tag-select-0600 */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v18 = pParse + 52 - v17 = *(*int32)(unsafe.Pointer(v18)) - *(*int32)(unsafe.Pointer(v18))++ - (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v17 + v20 = pParse + 56 + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(v20))++ + (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FaddrSortIndex = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor, (*TExprList)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy)).FnExpr+int32(1)+(*TExprList)(unsafe.Pointer(pEList)).FnExpr, 0, pKeyInfo, -int32(8)) } else { (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FaddrSortIndex = -int32(1) } /* If the output is destined for a temporary table, open that table. + ** tag-select-0630 */ if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_EphemTab) { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -125244,8 +126061,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprDelete(tls, db, (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(ii)*32))).FpExpr) _sqlite3DbFree(tls, db, (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(ii)*32))).FzEName) (*TExprList)(unsafe.Pointer(pEList)).FnExpr-- - goto _19 - _19: + goto _21 + _21: ; ii-- } @@ -125257,14 +126074,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(ii)*32 + 16 + 4))&0x40>>6)) == 0 { (*TExpr)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(ii)*32))).FpExpr)).Fop = uint8(TK_NULL) } - goto _20 - _20: + goto _22 + _22: ; ii++ } } } - /* Set the limiter. + /* Set the limiter. tag-select-0650 */ iEnd = _sqlite3VdbeMakeLabel(tls, pParse) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_FixedLimit) == uint32(0) { @@ -125275,16 +126092,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if (*TSelect)(unsafe.Pointer(p)).FiLimit == 0 && (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FaddrSortIndex >= 0 { _sqlite3VdbeChangeOpcode(tls, v, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FaddrSortIndex, uint8(OP_SorterOpen)) - p21 = bp + 16 + 36 - *(*Tu8)(unsafe.Pointer(p21)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p21))) | libc.Int32FromInt32(SORTFLAG_UseSorter)) + p23 = bp + 16 + 36 + *(*Tu8)(unsafe.Pointer(p23)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p23))) | libc.Int32FromInt32(SORTFLAG_UseSorter)) } - /* Open an ephemeral index to use for the distinct set. + /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v23 = pParse + 52 - v22 = *(*int32)(unsafe.Pointer(v23)) - *(*int32)(unsafe.Pointer(v23))++ - (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v22 + v25 = pParse + 56 + v24 = *(*int32)(unsafe.Pointer(v25)) + *(*int32)(unsafe.Pointer(v25))++ + (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 (*(*TDistinctCtx)(unsafe.Pointer(bp))).FaddrTnct = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct, 0, 0, _sqlite3KeyInfoFromExprList(tls, pParse, (*TSelect)(unsafe.Pointer(p)).FpEList, 0, 0), -int32(8)) _sqlite3VdbeChangeP5(tls, v, uint16(BTREE_UNORDERED)) (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = uint8(WHERE_DISTINCT_UNORDERED) @@ -125293,12 +126110,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if !(isAgg != 0) && pGroupBy == uintptr(0) { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 { - v24 = int32(WHERE_WANT_DISTINCT) + v26 = int32(WHERE_WANT_DISTINCT) } else { - v24 = 0 + v26 = 0 } - /* No aggregate functions and no GROUP BY clause */ - wctrlFlags = uint16(libc.Uint32FromInt32(v24) | (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_FixedLimit)) + /* No aggregate functions and no GROUP BY clause. tag-select-0700 */ + wctrlFlags = uint16(libc.Uint32FromInt32(v26) | (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_FixedLimit)) pWin = (*TSelect)(unsafe.Pointer(p)).FpWin /* Main window object (or NULL) */ if pWin != 0 { _sqlite3WindowCodeInit(tls, pParse, p) @@ -125332,10 +126149,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v26 = pParse + 56 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regGosub = v25 + v28 = pParse + 60 + *(*int32)(unsafe.Pointer(v28))++ + v27 = *(*int32)(unsafe.Pointer(v28)) + regGosub = v27 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -125369,8 +126186,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _27 - _27: + goto _29 + _29: ; k-- pItem2 += 32 @@ -125385,8 +126202,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _28 - _28: + goto _30 + _30: ; k-- pItem2 += 32 @@ -125415,8 +126232,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _29 - _29: + goto _31 + _31: ; ii1++ } @@ -125446,11 +126263,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v30 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v30 = 0 + v32 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v30) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -125472,7 +126289,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r goto select_end } /* Processing for aggregates with GROUP BY is very different and - ** much more complex than aggregates without a GROUP BY. + ** much more complex than aggregates without a GROUP BY. tag-select-0810 */ if pGroupBy != 0 { /* Return address register for reset subroutine */ pDistinct = uintptr(0) @@ -125484,47 +126301,47 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v31 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v31 = 0 + v33 = 0 } - distFlag = libc.Uint16FromInt32(v31) + distFlag = libc.Uint16FromInt32(v33) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v33 = pParse + 52 - v32 = *(*int32)(unsafe.Pointer(v33)) - *(*int32)(unsafe.Pointer(v33))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v32 + v35 = pParse + 56 + v34 = *(*int32)(unsafe.Pointer(v35)) + *(*int32)(unsafe.Pointer(v35))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v35 = pParse + 56 - *(*int32)(unsafe.Pointer(v35))++ - v34 = *(*int32)(unsafe.Pointer(v35)) - iUseFlag = v34 - v37 = pParse + 56 + v37 = pParse + 60 *(*int32)(unsafe.Pointer(v37))++ v36 = *(*int32)(unsafe.Pointer(v37)) - iAbortFlag = v36 - v39 = pParse + 56 + iUseFlag = v36 + v39 = pParse + 60 *(*int32)(unsafe.Pointer(v39))++ v38 = *(*int32)(unsafe.Pointer(v39)) - regOutputRow = v38 - addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v41 = pParse + 56 + iAbortFlag = v38 + v41 = pParse + 60 *(*int32)(unsafe.Pointer(v41))++ v40 = *(*int32)(unsafe.Pointer(v41)) - regReset = v40 + regOutputRow = v40 + addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) + v43 = pParse + 60 + *(*int32)(unsafe.Pointer(v43))++ + v42 = *(*int32)(unsafe.Pointer(v43)) + regReset = v42 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) /* Begin a loop that will extract all source rows in GROUP BY order. @@ -125534,16 +126351,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v42 = int32(WHERE_DISTINCTBY) + v44 = int32(WHERE_DISTINCTBY) } else { - v42 = int32(WHERE_GROUPBY) + v44 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v43 = int32(WHERE_SORTBYGROUP) + v45 = int32(WHERE_SORTBYGROUP) } else { - v43 = 0 + v45 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v42|v43|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -125561,11 +126378,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v44 = __ccgo_ts + 20382 + v46 = __ccgo_ts + 20467 } else { - v44 = __ccgo_ts + 20391 + v46 = __ccgo_ts + 20476 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19234, libc.VaList(bp+176, v44)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19319, libc.VaList(bp+176, v46)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -125579,8 +126396,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r nCol++ j++ } - goto _45 - _45: + goto _47 + _47: ; i++ } @@ -125598,8 +126415,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _46 - _46: + goto _48 + _48: ; i++ } @@ -125610,12 +126427,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v49 = pParse + 52 - v48 = *(*int32)(unsafe.Pointer(v49)) - *(*int32)(unsafe.Pointer(v49))++ - v47 = v48 - sortPTab = v47 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v47 + v51 = pParse + 56 + v50 = *(*int32)(unsafe.Pointer(v51)) + *(*int32)(unsafe.Pointer(v51))++ + v49 = v50 + sortPTab = v49 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -125654,14 +126471,22 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(j < (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) { break } + iOrderByCol = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pGroupBy + 8 + uintptr(j)*32 + 24))) if groupBySort != 0 { _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), sortPTab, j, iBMem+j) } else { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(1) _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(j)*32))).FpExpr, iBMem+j) } - goto _50 - _50: + if iOrderByCol != 0 { + pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { + _sqlite3ExprToRegister(tls, pX, iAMem+j) + } + } + goto _52 + _52: ; j++ } @@ -125677,8 +126502,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** and resets the aggregate accumulator registers in preparation ** for the next GROUP BY batch. */ - _sqlite3ExprCodeMove(tls, pParse, iBMem, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regOutputRow, addrOutputRow) + _sqlite3ExprCodeMove(tls, pParse, iBMem, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) _sqlite3VdbeAddOp2(tls, v, int32(OP_IfPos), iAbortFlag, addrEnd) _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) /* Update the aggregate accumulators based on the content of @@ -125731,10 +126556,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v51 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v51 - if v51 != uintptr(0) { - /* If isSimpleCount() returns a pointer to a Table structure, then + v53 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v53 + if v53 != uintptr(0) { + /* tag-select-0821 + ** + ** If isSimpleCount() returns a pointer to a Table structure, then ** the SQL statement is of the form: ** ** SELECT count(*) FROM <tbl> @@ -125747,16 +126574,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** is better to execute the op on an index, as indexes are almost ** always spread across less pages than their corresponding tables. */ - iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v53 = pParse + 52 - v52 = *(*int32)(unsafe.Pointer(v53)) - *(*int32)(unsafe.Pointer(v53))++ - iCsr = v52 /* Iterator variable */ + iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) + v55 = pParse + 56 + v54 = *(*int32)(unsafe.Pointer(v55)) + *(*int32)(unsafe.Pointer(v55))++ + iCsr = v54 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ - _sqlite3CodeVerifySchema(tls, pParse, iDb) - _sqlite3TableLock(tls, pParse, iDb, (*TTable)(unsafe.Pointer(pTab1)).Ftnum, uint8(0), (*TTable)(unsafe.Pointer(pTab1)).FzName) + _sqlite3CodeVerifySchema(tls, pParse, iDb1) + _sqlite3TableLock(tls, pParse, iDb1, (*TTable)(unsafe.Pointer(pTab1)).Ftnum, uint8(0), (*TTable)(unsafe.Pointer(pTab1)).FzName) /* Search for the index that has the lowest scan cost. ** ** (2011-04-15) Do not do a full scan of an unordered index. @@ -125769,7 +126596,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !((*TTable)(unsafe.Pointer(pTab1)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { pBest = _sqlite3PrimaryKeyIndex(tls, pTab1) } - if !(int32(uint32(*(*uint16)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + 60 + 4))&0x1>>0)) != 0) { + if !(int32(*(*uint32)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8 + 24 + 4))&0x1>>0) != 0) { pIdx = (*TTable)(unsafe.Pointer(pTab1)).FpIndex for { if !(pIdx != 0) { @@ -125778,8 +126605,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _54 - _54: + goto _56 + _56: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -125789,15 +126616,17 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pKeyInfo2 = _sqlite3KeyInfoOfIndex(tls, pParse, pBest) } /* Open a read-only cursor, execute the OP_Count, close the cursor. */ - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenRead), iCsr, libc.Int32FromUint32(iRoot), iDb, int32(1)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenRead), iCsr, libc.Int32FromUint32(iRoot), iDb1, int32(1)) if pKeyInfo2 != 0 { _sqlite3VdbeChangeP4(tls, v, -int32(1), pKeyInfo2, -int32(8)) } _assignAggregateRegisters(tls, pParse, pAggInfo) - _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iCsr, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+(*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn+libc.Int32FromInt32(0)) + _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iCsr, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg+(*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn+0) _sqlite3VdbeAddOp1(tls, v, int32(OP_Close), iCsr) _explainSimpleCount(tls, pParse, pTab1, pBest) } else { + /* The general case of an aggregate query without GROUP BY + ** tag-select-0822 */ regAcc = 0 /* "populate accumulators" flag */ pDistinct1 = uintptr(0) distFlag1 = uint16(0) @@ -125817,32 +126646,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _55 + goto _57 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _55 - _55: + goto _57 + _57: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v57 = pParse + 56 - *(*int32)(unsafe.Pointer(v57))++ - v56 = *(*int32)(unsafe.Pointer(v57)) - regAcc = v56 + v59 = pParse + 60 + *(*int32)(unsafe.Pointer(v59))++ + v58 = *(*int32)(unsafe.Pointer(v59)) + regAcc = v58 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v58 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v58 = 0 + v60 = 0 } - distFlag1 = libc.Uint16FromInt32(v58) + distFlag1 = libc.Uint16FromInt32(v60) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -125884,10 +126713,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20382) + _explainTempTable(tls, pParse, __ccgo_ts+20467) } /* If there is an ORDER BY clause, then we need to sort the results - ** and send them to the callback one by one. + ** and send them to the callback one by one. tag-select-0900 */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { _generateSortTail(tls, pParse, p, bp+16, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pDest) @@ -125990,7 +126819,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -126006,7 +126835,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20400, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20485, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -126096,7 +126925,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -126258,7 +127087,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20465, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20550, 0) goto trigger_cleanup } iDb = int32(1) @@ -126282,8 +127111,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ** name on pTableName if we are reparsing out of the schema table */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && iDb != int32(1) { - _sqlite3DbFree(tls, db, (*(*TSrcItem)(unsafe.Pointer(pTableName + 8))).FzDatabase) - (*(*TSrcItem)(unsafe.Pointer(pTableName + 8))).FzDatabase = uintptr(0) + _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pTableName + 8 + 72))) + *(*uintptr)(unsafe.Pointer(pTableName + 8 + 72)) = uintptr(0) } /* If the trigger name was unqualified, and the table is a temp table, ** then set iDb to 1 to create the trigger in the temporary database. @@ -126298,7 +127127,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20511, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20596, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -126308,11 +127137,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20519, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20604, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20560, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20645, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -126321,13 +127150,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20511, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20596, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20600, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20685, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -126335,8 +127164,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6589, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20626, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20711, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -126344,15 +127173,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20664 + v1 = __ccgo_ts + 20749 } else { - v1 = __ccgo_ts + 20671 + v1 = __ccgo_ts + 20756 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20677, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20762, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20714, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20799, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -126372,9 +127201,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6597 + v3 = __ccgo_ts + 6659 } else { - v3 = __ccgo_ts + 6130 + v3 = __ccgo_ts + 6147 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -126474,7 +127303,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20511, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20596, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -126496,7 +127325,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20760, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20845, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -126512,10 +127341,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20808, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+20893, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20883, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20968, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -126756,7 +127585,7 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int if SQLITE_OK != _sqlite3ReadSchema(tls, pParse) { goto drop_trigger_cleanup } - zDb = (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzDatabase + zDb = *(*uintptr)(unsafe.Pointer(pName + 8 + 72)) zName = (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName i = OMIT_TEMPDB for { @@ -126783,7 +127612,7 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20912, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20997, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } @@ -126825,9 +127654,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6597 + v1 = __ccgo_ts + 6659 } else { - v1 = __ccgo_ts + 6130 + v1 = __ccgo_ts + 6147 } zTab = v1 if iDb == int32(1) { @@ -126842,7 +127671,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20932, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21017, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -126975,11 +127804,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 20994 + v1 = __ccgo_ts + 21079 } else { - v1 = __ccgo_ts + 21001 + v1 = __ccgo_ts + 21086 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21008, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21093, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -127045,7 +127874,8 @@ func _sqlite3TriggerStepSrc(tls *libc.TLS, pParse uintptr, pStep uintptr) (r uin pSchema = (*TTrigger)(unsafe.Pointer((*TTriggerStep)(unsafe.Pointer(pStep)).FpTrig)).FpSchema (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = zName if pSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSchema = pSchema + *(*uintptr)(unsafe.Pointer(pSrc + 8 + 72)) = pSchema + libc.SetBitFieldPtr32Uint32(pSrc+8+24+4, libc.Uint32FromInt32(1), 16, 0x10000) } if (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 { pDup = _sqlite3SrcListDup(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom, 0) @@ -127080,7 +127910,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21056, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21141, 0) return int32(1) } @@ -127178,7 +128008,7 @@ func _sqlite3ReturningSubqueryCorrelated(tls *libc.TLS, pWalker uintptr, pSelect if !(i < (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) { break } - if (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104))).FpTab == *(*uintptr)(unsafe.Pointer(pWalker + 40)) { + if (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80))).FpSTab == *(*uintptr)(unsafe.Pointer(pWalker + 40)) { *(*Tu32)(unsafe.Pointer(pSelect + 4)) |= uint32(SF_Correlated) (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) break @@ -127226,12 +128056,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint // ** is generated in-line. // */ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { - bp := tls.Alloc(304) - defer tls.Free(304) + bp := tls.Alloc(272) + defer tls.Free(272) var db, pCol, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 var _ /* sFrom at bp+128 */ TSrcList - var _ /* sNC at bp+240 */ TNameContext + var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe @@ -127247,11 +128077,11 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab return } libc.Xmemset(tls, bp, 0, uint64(128)) - libc.Xmemset(tls, bp+128, 0, uint64(112)) + libc.Xmemset(tls, bp+128, 0, uint64(88)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpTab = pTab + (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) @@ -127261,24 +128091,24 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab _sqlite3ExprListDelete(tls, db, (*(*TSelect)(unsafe.Pointer(bp))).FpEList) pNew = _sqlite3ExpandReturning(tls, pParse, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, pTab) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - libc.Xmemset(tls, bp+240, 0, uint64(56)) + libc.Xmemset(tls, bp+216, 0, uint64(56)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 52 + v2 = pParse + 56 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 } - (*(*TNameContext)(unsafe.Pointer(bp + 240))).FpParse = pParse - *(*int32)(unsafe.Pointer(bp + 240 + 16)) = regIn - (*(*TNameContext)(unsafe.Pointer(bp + 240))).FncFlags = int32(NC_UBaseReg) + (*(*TNameContext)(unsafe.Pointer(bp + 216))).FpParse = pParse + *(*int32)(unsafe.Pointer(bp + 216 + 16)) = regIn + (*(*TNameContext)(unsafe.Pointer(bp + 216))).FncFlags = int32(NC_UBaseReg) (*TParse)(unsafe.Pointer(pParse)).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab = pTab - if _sqlite3ResolveExprListNames(tls, bp+240, pNew) == SQLITE_OK && !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + if _sqlite3ResolveExprListNames(tls, bp+216, pNew) == SQLITE_OK && !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 56)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -127346,7 +128176,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6327, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6344, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -127448,7 +128278,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21098, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21183, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -127542,7 +128372,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -127551,7 +128381,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** invocation is disallowed if (a) the sub-program is really a trigger, ** not a foreign key action, and (b) the flag to enable recursive triggers ** is clear. */ - _sqlite3VdbeChangeP5(tls, v, uint16(libc.Uint8FromInt32(bRecursive))) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(bRecursive)) } } @@ -127863,15 +128693,15 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p pLimit2 = uintptr(0) pOrderBy2 = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pTab = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab + pTab = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab _ = pOrderBy _ = pLimit pSrc = _sqlite3SrcListDup(tls, db, pTabList, 0) pWhere2 = _sqlite3ExprDup(tls, db, pWhere, 0) if pSrc != 0 { (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) - (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpTab)).FnTabRef-- - (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpTab = uintptr(0) + (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab)).FnTabRef-- + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = uintptr(0) } if pPk != 0 { i = 0 @@ -128033,7 +128863,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 52 + v4 = pParse + 56 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -128137,7 +128967,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui chngPk = uint8(1) } else { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21112, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21197, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) goto update_cleanup } } @@ -128157,13 +128987,13 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21148, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21233, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8030 + v11 = __ccgo_ts + 8092 } else { v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } @@ -128239,11 +129069,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 56 + v16 = pParse + 60 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) reg = v15 - *(*int32)(unsafe.Pointer(pParse + 56)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -128252,11 +129082,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 56 + v19 = pParse + 60 *(*int32)(unsafe.Pointer(v19))++ v18 = *(*int32)(unsafe.Pointer(v19)) reg = v18 - *(*int32)(unsafe.Pointer(pParse + 56)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } @@ -128278,7 +129108,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 56 + v21 = pParse + 60 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ @@ -128299,7 +129129,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 56 + v24 = pParse + 60 *(*int32)(unsafe.Pointer(v24))++ v23 = *(*int32)(unsafe.Pointer(v24)) v22 = v23 @@ -128307,16 +129137,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui regOldRowid = v22 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 56 + v26 = pParse + 60 *(*int32)(unsafe.Pointer(v26))++ v25 = *(*int32)(unsafe.Pointer(v26)) regNewRowid = v25 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -128348,7 +129178,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<<libc.Int32FromInt32(32)) != uint64(0) && !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) && !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) && pUpsert == uintptr(0) { - v29 = pParse + 56 + v29 = pParse + 60 *(*int32)(unsafe.Pointer(v29))++ v28 = *(*int32)(unsafe.Pointer(v29)) regRowCount = v28 @@ -128356,7 +129186,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } if nChangeFrom == 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, regRowSet, regOldRowid) - v31 = pParse + 52 + v31 = pParse + 56 v30 = *(*int32)(unsafe.Pointer(v31)) *(*int32)(unsafe.Pointer(v31))++ iEph = v30 @@ -128369,9 +129199,9 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } nPk = int16(v32) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(nPk) - *(*int32)(unsafe.Pointer(pParse + 56)) += nChangeFrom - v34 = pParse + 56 + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(nPk) + *(*int32)(unsafe.Pointer(pParse + 60)) += nChangeFrom + v34 = pParse + 60 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regKey = v33 @@ -128382,7 +129212,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui v35 = 0 } nEphCol = int32(nPk) + nChangeFrom + v35 - v37 = pParse + 52 + v37 = pParse + 56 v36 = *(*int32)(unsafe.Pointer(v37)) *(*int32)(unsafe.Pointer(v37))++ iEph = v36 @@ -128469,7 +129299,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** leave it in register regOldRowid. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iDataCur, regOldRowid) if eOnePass == ONEPASS_OFF { - v39 = pParse + 56 + v39 = pParse + 60 *(*int32)(unsafe.Pointer(v39))++ v38 = *(*int32)(unsafe.Pointer(v39)) *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v38 @@ -128845,7 +129675,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21167) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21252) } goto update_cleanup update_cleanup: @@ -128902,13 +129732,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 52 + v2 = pParse + 56 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nArg + *(*int32)(unsafe.Pointer(pParse + 60)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -128950,11 +129780,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 56 + v5 = pParse + 60 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 56 + v7 = pParse + 60 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -129173,7 +130003,7 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr return rc } /* Check to see if the conflict target matches the rowid. */ - pTab = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab + pTab = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab pTarget = (*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertTarget iCursor = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FiCursor if v3 = (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && (*TExprList)(unsafe.Pointer(pTarget)).FnExpr == int32(1); v3 { @@ -129279,9 +130109,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]uint8)(unsafe.Pointer(bp + 200)))[0] = uint8(0) } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21180, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21265, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21184, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21269, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -129370,7 +130200,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nPk + *(*int32)(unsafe.Pointer(pParse + 60)) += nPk i = 0 for { if !(i < nPk) { @@ -129384,7 +130214,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12595, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12657, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -129466,7 +130296,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21257, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21261, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21342, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21346, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -129557,7 +130387,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -129579,39 +130409,41 @@ build_vacuum_end: // ** This routine implements the OP_Vacuum opcode of the VDBE. // */ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, pOut uintptr) (r int32) { - bp := tls.Alloc(32) - defer tls.Free(32) + bp := tls.Alloc(112) + defer tls.Free(112) var i, isMemDb, nDb, nRes, rc, v1, v2 int32 var id, pDb, pMain, pTemp, zDbMain, zOut uintptr var pgflags, saved_mDbFlags, saved_openFlags Tu32 var saved_flags Tu64 var saved_mTrace Tu8 var saved_nChange, saved_nTotalChange Ti64 - var _ /* meta at bp+8 */ Tu32 - var _ /* sz at bp+0 */ Ti64 + var _ /* iRandom at bp+0 */ Tu64 + var _ /* meta at bp+64 */ Tu32 + var _ /* sz at bp+56 */ Ti64 + var _ /* zDbVacuum at bp+8 */ [42]uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = i, id, isMemDb, nDb, nRes, pDb, pMain, pTemp, pgflags, rc, saved_flags, saved_mDbFlags, saved_mTrace, saved_nChange, saved_nTotalChange, saved_openFlags, zDbMain, zOut, v1, v2 rc = SQLITE_OK /* Saved trace settings */ pDb = uintptr(0) /* Name of output file */ - pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* sync flags for output db */ + pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21265) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21350) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21305) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21390) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21348) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21433) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) *(*uint32)(unsafe.Pointer(db + 76)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) *(*uint32)(unsafe.Pointer(db + 76)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) } else { - zOut = __ccgo_ts + 1662 + zOut = __ccgo_ts + 1663 } /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and @@ -129628,22 +130460,24 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p zDbMain = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName pMain = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpBt isMemDb = _sqlite3PagerIsMemdb(tls, _sqlite3BtreePager(tls, pMain)) - /* Attach the temporary database as 'vacuum_db'. The synchronous pragma + /* Attach the temporary database as 'vacuum_XXXXXX'. The synchronous pragma ** can be set to 'off' for this file, as it is not recovered if a crash ** occurs anyway. The integrity of the database is maintained by a ** (possibly synchronous) transaction opened on the main database before ** sqlite3BtreeCopyFile() is called. ** ** An optimization would be to use a non-journaled pager. - ** (Later:) I tried setting "PRAGMA vacuum_db.journal_mode=OFF" but + ** (Later:) I tried setting "PRAGMA vacuum_XXXXXX.journal_mode=OFF" but ** that actually made the VACUUM run slower. Very little journalling ** actually occurs when doing a vacuum since the vacuum_db is initially ** empty. Only the journal header is written. Apparently it takes more ** time to parse and run the PRAGMA to turn journalling off than it does ** to write the journal header file. */ + Xsqlite3_randomness(tls, int32(8), bp) + Xsqlite3_snprintf(tls, int32(42), bp+8, __ccgo_ts+21451, libc.VaList(bp+80, *(*Tu64)(unsafe.Pointer(bp)))) nDb = (*Tsqlite3)(unsafe.Pointer(db)).FnDb - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21366, libc.VaList(bp+24, zOut)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21466, libc.VaList(bp+80, zOut, bp+8)) (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags = saved_openFlags if rc != SQLITE_OK { goto end_of_vacuum @@ -129652,10 +130486,10 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pTemp = (*TDb)(unsafe.Pointer(pDb)).FpBt if pOut != 0 { id = _sqlite3PagerFile(tls, _sqlite3BtreePager(tls, pTemp)) - *(*Ti64)(unsafe.Pointer(bp)) = 0 - if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != uintptr(0) && (_sqlite3OsFileSize(tls, id, bp) != SQLITE_OK || *(*Ti64)(unsafe.Pointer(bp)) > 0) { + *(*Ti64)(unsafe.Pointer(bp + 56)) = 0 + if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != uintptr(0) && (_sqlite3OsFileSize(tls, id, bp+56) != SQLITE_OK || *(*Ti64)(unsafe.Pointer(bp + 56)) > 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21389) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21482) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -129672,7 +130506,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** 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, __ccgo_ts+14972) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15034) if rc != SQLITE_OK { goto end_of_vacuum } @@ -129703,11 +130537,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21416, libc.VaList(bp+24, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21509, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21524, libc.VaList(bp+24, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21617, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -129716,7 +130550,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21578, libc.VaList(bp+24, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21671, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -129726,7 +130560,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21729, libc.VaList(bp+24, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21808, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -129738,8 +130572,8 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p } /* GetMeta() and UpdateMeta() cannot fail in this context because ** we already have page 1 loaded into cache and marked dirty. */ - _sqlite3BtreeGetMeta(tls, pMain, libc.Int32FromUint8(_aCopy[i]), bp+8) - rc = _sqlite3BtreeUpdateMeta(tls, pTemp, libc.Int32FromUint8(_aCopy[i]), *(*Tu32)(unsafe.Pointer(bp + 8))+uint32(_aCopy[i+int32(1)])) + _sqlite3BtreeGetMeta(tls, pMain, libc.Int32FromUint8(_aCopy[i]), bp+64) + rc = _sqlite3BtreeUpdateMeta(tls, pTemp, libc.Int32FromUint8(_aCopy[i]), *(*Tu32)(unsafe.Pointer(bp + 64))+uint32(_aCopy[i+int32(1)])) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130253,7 +131087,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12825, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12887, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -130376,7 +131210,7 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21859, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21931, libc.VaList(bp+8, pParse+272)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. @@ -130386,14 +131220,14 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21883, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21955, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+21982, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22054, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -130477,7 +131311,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22001, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22073, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -130519,9 +131353,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22043, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22115, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3859, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3860, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -130534,7 +131368,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22073 + zFormat = __ccgo_ts + 22145 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -130560,7 +131394,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1662) + zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1663) i = 0 nType = _sqlite3Strlen30(tls, zType) i = 0 @@ -130568,7 +131402,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16672, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16737, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -130649,13 +131483,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22119, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22191, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3859, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -130736,7 +131570,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22119, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22191, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -130780,11 +131614,11 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i break } *(*int32)(unsafe.Pointer(bp + 424)) = 0 - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp + 424)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp + 424)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp + 424)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22138, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22210, 0) return int32(SQLITE_ERROR) } goto _1 @@ -130795,9 +131629,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(156236))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(156238)) + return _sqlite3MisuseError(tls, int32(157361)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -130839,7 +131673,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3859 + v3 = __ccgo_ts + 3860 } else { v3 = uintptr(0) } @@ -131315,7 +132149,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3859, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -131379,7 +132213,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(156732)) + rc = _sqlite3MisuseError(tls, int32(157856)) } else { ap = va switch op { @@ -131392,7 +132226,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(156754)) + rc = _sqlite3MisuseError(tls, int32(157878)) break } _ = ap @@ -131540,8 +132374,8 @@ type TWhereLoop = struct { FnTop Tu16 FnDistinctCol Tu16 FpIndex uintptr + FpOrderBy uintptr } - F__ccgo_pad2 [8]byte } FwsFlags Tu32 FnLTerm Tu16 @@ -131559,7 +132393,7 @@ type TWherePath = struct { FrevLoop TBitmask FnRow TLogEst FrCost TLogEst - FrUnsorted TLogEst + FrUnsort TLogEst FisOrdered Ti8 FaLoop uintptr } @@ -131761,8 +132595,8 @@ type TWhereLoop1 = struct { FnTop Tu16 FnDistinctCol Tu16 FpIndex uintptr + FpOrderBy uintptr } - F__ccgo_pad2 [8]byte } FwsFlags Tu32 FnLTerm Tu16 @@ -131821,7 +132655,7 @@ type TWherePath1 = struct { FrevLoop TBitmask FnRow TLogEst FrCost TLogEst - FrUnsorted TLogEst + FrUnsort TLogEst FisOrdered Ti8 FaLoop uintptr } @@ -132101,7 +132935,6 @@ type WhereInfo1 = TWhereInfo1 ** The particular combination of bits in each WhereLoop help to ** determine the algorithm that WhereLoop represents. */ -/* 0x02000000 -- available for reuse */ /************** End of whereInt.h ********************************************/ /************** Continuing where we left off in wherecode.c ******************/ @@ -132114,10 +132947,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22151 + return __ccgo_ts + 22223 } if i == -int32(1) { - return __ccgo_ts + 16781 + return __ccgo_ts + 16846 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -132136,10 +132969,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22158, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22230, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22164, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22236, int32(1)) } i = 0 for { @@ -132147,7 +132980,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13215, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13277, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -132156,11 +132989,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5170, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22164, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22236, int32(1)) } i = 0 for { @@ -132168,16 +133001,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13215, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13277, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5172, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5170, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) } } @@ -132204,13 +133037,27 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { var nEq, nSkip Tu16 var pIndex, z, v2 uintptr _, _, _, _, _, _, _ = i, j, nEq, nSkip, pIndex, z, v2 - pIndex = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex - nEq = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq + pIndex = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex + nEq = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq nSkip = (*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22166, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -132218,12 +133065,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22158, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22230, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22169 + v2 = __ccgo_ts + 22241 } else { - v2 = __ccgo_ts + 22174 + v2 = __ccgo_ts + 22246 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -132233,96 +133080,119 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } j = i if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BTM_LIMIT) != 0 { - _explainAppendTerm(tls, pStr, pIndex, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm), j, i, __ccgo_ts+22182) + _explainAppendTerm(tls, pStr, pIndex, libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22254) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { - _explainAppendTerm(tls, pStr, pIndex, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop), j, i, __ccgo_ts+22184) + _explainAppendTerm(tls, pStr, pIndex, libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22256) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5170, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) } // C documentation // // /* -// ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN -// ** command, or if stmt_scanstatus_v2() stats are enabled, or if SQLITE_DEBUG -// ** was defined at compile-time. If it is not a no-op, a single OP_Explain -// ** opcode is added to the output to describe the table scan strategy in pLevel. -// ** -// ** If an OP_Explain opcode is added to the VM, its address is returned. -// ** Otherwise, if no OP_Explain is coded, zero is returned. +// ** This function sets the P4 value of an existing OP_Explain opcode to +// ** text describing the loop in pLevel. If the OP_Explain opcode already has +// ** a P4 value, it is freed before it is overwritten. // */ -func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags Tu16) (r int32) { +func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTabList uintptr, pLevel uintptr, wctrlFlags Tu16) { bp := tls.Alloc(160) defer tls.Free(160) var cRangeOp uint8 - var db, pIdx, pItem, pLoop, v, zFmt, zMsg, zRowid, v1, v2 uintptr + var db, pIdx, pItem, pLoop, pOp, zFmt, zRowid, v1, v2, v3 uintptr var flags Tu32 - var isSearch, ret int32 + var isSearch int32 var _ /* str at bp+0 */ TStrAccum var _ /* zBuf at bp+32 */ [100]uint8 - _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cRangeOp, db, flags, isSearch, pIdx, pItem, pLoop, ret, v, zFmt, zMsg, zRowid, v1, v2 - ret = 0 + _, _, _, _, _, _, _, _, _, _, _, _, _ = cRangeOp, db, flags, isSearch, pIdx, pItem, pLoop, pOp, zFmt, zRowid, v1, v2, v3 if (*TParse)(unsafe.Pointer(pParse)).FpToplevel != 0 { v1 = (*TParse)(unsafe.Pointer(pParse)).FpToplevel } else { v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - pItem = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104 - v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* VM being constructed */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ + pOp = _sqlite3VdbeGetOp(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, addr) + pItem = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ + if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + return + } pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop flags = (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags - if flags&uint32(WHERE_MULTI_OR) != 0 || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { - return 0 - } - isSearch = libc.BoolInt32(flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) != uint32(0) || flags&uint32(WHERE_VIRTUALTABLE) == uint32(0) && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) > 0 || libc.Int32FromUint16(wctrlFlags)&(libc.Int32FromInt32(WHERE_ORDERBY_MIN)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)) != 0) + isSearch = libc.BoolInt32(flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) != uint32(0) || flags&uint32(WHERE_VIRTUALTABLE) == uint32(0) && libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq) > 0 || libc.Int32FromUint16(wctrlFlags)&(libc.Int32FromInt32(WHERE_ORDERBY_MIN)|libc.Int32FromInt32(WHERE_ORDERBY_MAX)) != 0) _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22186 + v2 = __ccgo_ts + 22258 } else { - v2 = __ccgo_ts + 22193 + v2 = __ccgo_ts + 22265 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22198, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22270, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) - pIdx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex - if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { + pIdx = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex + if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11378 + zFmt = __ccgo_ts + 11440 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22204 + zFmt = __ccgo_ts + 22276 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22237 + zFmt = __ccgo_ts + 22309 } else { - if flags&uint32(WHERE_IDX_ONLY) != 0 { - zFmt = __ccgo_ts + 22262 + if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { + zFmt = __ccgo_ts + 22334 } else { - zFmt = __ccgo_ts + 22280 + zFmt = __ccgo_ts + 22352 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22289, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22361, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16781 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22297, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16846 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22369, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = uint8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22328, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22400, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -132332,10 +133202,16 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22338, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22410, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22343, libc.VaList(bp+144, (*(*struct { + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22415) + if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { + v3 = __ccgo_ts + 22437 + } else { + v3 = __ccgo_ts + 22445 + } + Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 F__ccgo4 uint8 FisOrdered Ti8 @@ -132354,10 +133230,42 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22370, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22451, 0) + } + _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) + (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) + *(*uintptr)(unsafe.Pointer(pOp + 16)) = _sqlite3StrAccumFinish(tls, bp) + } +} + +// C documentation +// +// /* +// ** This function is a no-op unless currently processing an EXPLAIN QUERY PLAN +// ** command, or if stmt_scanstatus_v2() stats are enabled, or if SQLITE_DEBUG +// ** was defined at compile-time. If it is not a no-op, a single OP_Explain +// ** opcode is added to the output to describe the table scan strategy in pLevel. +// ** +// ** If an OP_Explain opcode is added to the VM, its address is returned. +// ** Otherwise, if no OP_Explain is coded, zero is returned. +// */ +func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr, pLevel uintptr, wctrlFlags Tu16) (r int32) { + var addr, ret int32 + var v, v1 uintptr + _, _, _, _ = addr, ret, v, v1 + ret = 0 + if (*TParse)(unsafe.Pointer(pParse)).FpToplevel != 0 { + v1 = (*TParse)(unsafe.Pointer(pParse)).FpToplevel + } else { + v1 = pParse + } + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { + if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe + addr = _sqlite3VdbeCurrentAddr(tls, v) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } - zMsg = _sqlite3StrAccumFinish(tls, bp) - ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) } return ret } @@ -132383,38 +133291,52 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp var _ /* zBuf at bp+32 */ [100]uint8 _, _, _, _, _, _, _, _, _ = db, i, pItem, pLoop, pTab, ret, v, z, zMsg ret = 0 - pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104 + pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* VM being constructed */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22381, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22462, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { - pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab + pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22169, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22241, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22402, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22483, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) for { - if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) { - break - } - z = _explainIndexColumnName(tls, (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex, i) + if !(i < libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq)) { + break + } + z = _explainIndexColumnName(tls, (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22158, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22230, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22169, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22241, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5170, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -132561,6 +133483,62 @@ func _updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintpt // C documentation // // /* +// ** The pOrderBy->a[].u.x.iOrderByCol values might be incorrect because +// ** columns might have been rearranged in the result set. This routine +// ** fixes them up. +// ** +// ** pEList is the new result set. The pEList->a[].u.x.iOrderByCol values +// ** contain the *old* locations of each expression. This is a temporary +// ** use of u.x.iOrderByCol, not its intended use. The caller must reset +// ** u.x.iOrderByCol back to zero for all entries in pEList before the +// ** caller returns. +// ** +// ** This routine changes pOrderBy->a[].u.x.iOrderByCol values from +// ** pEList->a[N].u.x.iOrderByCol into N+1. (The "+1" is because of the 1-based +// ** indexing used by iOrderByCol.) Or if no match, iOrderByCol is set to zero. +// */ +func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { + var i, j, t int32 + _, _, _ = i, j, t + if pOrderBy == uintptr(0) { + return + } + i = 0 + for { + if !(i < (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr) { + break + } + t = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 24))) + if t == 0 { + goto _1 + } + j = 0 + for { + if !(j < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { + break + } + if libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 24))) == t { + *(*Tu16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 24)) = libc.Uint16FromInt32(j + int32(1)) + break + } + goto _2 + _2: + ; + j++ + } + if j >= (*TExprList)(unsafe.Pointer(pEList)).FnExpr { + *(*Tu16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 24)) = uint16(0) + } + goto _1 + _1: + ; + i++ + } +} + +// C documentation +// +// /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the // ** LHS. But not all terms in the vector are indexable and the terms might @@ -132590,9 +133568,9 @@ func _updateRangeAffinityStr(tls *libc.TLS, pRight uintptr, n int32, zAff uintpt // ** 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) (r uintptr) { - var db, p, pLhs, pNew, pOrderBy, pOrigLhs, pOrigRhs, pRhs, pSelect uintptr - var i, iField int32 - _, _, _, _, _, _, _, _, _, _, _ = db, i, iField, p, pLhs, pNew, pOrderBy, pOrigLhs, pOrigRhs, pRhs, pSelect + var db, p, pLhs, pNew, pOrigLhs, pOrigRhs, pRhs, pSelect, v4 uintptr + var i, iField, v3 int32 + _, _, _, _, _, _, _, _, _, _, _, _ = db, i, iField, p, pLhs, pNew, pOrigLhs, pOrigRhs, pRhs, pSelect, v3, v4 db = (*TParse)(unsafe.Pointer(pParse)).Fdb pNew = _sqlite3ExprDup(tls, db, pX, 0) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed) == 0 { @@ -132623,6 +133601,9 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p } /* Duplicate PK column */ pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) + if pRhs != 0 { + *(*Tu16)(unsafe.Pointer(pRhs + 8 + uintptr((*TExprList)(unsafe.Pointer(pRhs)).FnExpr-int32(1))*32 + 24)) = libc.Uint16FromInt32(iField + int32(1)) + } if pOrigLhs != 0 { pLhs = _sqlite3ExprListAppend(tls, pParse, pLhs, (*(*TExprList_item)(unsafe.Pointer(pOrigLhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigLhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) @@ -132639,6 +133620,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs + v4 = pParse + 148 + *(*int32)(unsafe.Pointer(v4))++ + v3 = *(*int32)(unsafe.Pointer(v4)) + (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ if pLhs != 0 && (*TExprList)(unsafe.Pointer(pLhs)).FnExpr == int32(1) { /* Take care here not to generate a TK_VECTOR containing only a ** single value. Since the parser never creates such a vector, some @@ -132648,23 +133633,21 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pNew)).FpLeft) (*TExpr)(unsafe.Pointer(pNew)).FpLeft = p } - if (*TSelect)(unsafe.Pointer(pSelect)).FpOrderBy != 0 { - /* If the SELECT statement has an ORDER BY clause, zero the - ** iOrderByCol variables. These are set to non-zero when an - ** ORDER BY term exactly matches one of the terms of the - ** result-set. Since the result-set of the SELECT statement may - ** have been modified or reordered, these variables are no longer - ** set correctly. Since setting them is just an optimization, - ** it's easiest just to zero them here. */ - pOrderBy = (*TSelect)(unsafe.Pointer(pSelect)).FpOrderBy + /* If either the ORDER BY clause or the GROUP BY clause contains + ** references to result-set columns, those references might now be + ** obsolete. So fix them up. + */ + if pRhs != 0 { + _adjustOrderByCol(tls, (*TSelect)(unsafe.Pointer(pSelect)).FpOrderBy, pRhs) + _adjustOrderByCol(tls, (*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy, pRhs) i = 0 for { - if !(i < (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr) { + if !(i < (*TExprList)(unsafe.Pointer(pRhs)).FnExpr) { break } - *(*Tu16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 24)) = uint16(0) - goto _3 - _3: + *(*Tu16)(unsafe.Pointer(pRhs + 8 + uintptr(i)*32 + 24)) = uint16(0) + goto _5 + _5: ; i++ } @@ -132681,6 +133664,203 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p // C documentation // // /* +// ** Generate code for a single X IN (....) term of the WHERE clause. +// ** +// ** This is a special-case of codeEqualityTerm() that works for IN operators +// ** only. It is broken out into a subroutine because this case is +// ** uncommon and by splitting it off into a subroutine, the common case +// ** runs faster. +// ** +// ** The current value for the constraint is left in register iTarget. +// ** This routine sets up a loop that will iterate over all values of X. +// */ +func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr + var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var _ /* iTab at bp+0 */ int32 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr + eType = int32(IN_INDEX_NOOP) + pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop + v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe + nEq = 0 + aiMap = uintptr(0) + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_VIRTUALTABLE) == uint32(0) && (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex != uintptr(0) && *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex)).FaSortOrder + uintptr(iEq))) != 0 { + bRev = libc.BoolInt32(!(bRev != 0)) + } + i = 0 + for { + if !(i < iEq) { + break + } + if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX { + _disableTerm(tls, pLevel, pTerm) + return + } + goto _1 + _1: + ; + i++ + } + i = iEq + for { + if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) { + break + } + if (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX { + nEq++ + } + goto _2 + _2: + ; + i++ + } + *(*int32)(unsafe.Pointer(bp)) = 0 + if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { + eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) + } else { + pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) + eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) + } + _sqlite3ExprDelete(tls, db, pX) + } else { + n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) + if nEq > n { + v3 = nEq + } else { + v3 = n + } + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) + eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + } + pX = pExpr + } + if eType == int32(IN_INDEX_INDEX_DESC) { + bRev = libc.BoolInt32(!(bRev != 0)) + } + if bRev != 0 { + v4 = int32(OP_Last) + } else { + v4 = int32(OP_Rewind) + } + _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) + if (*(*struct { + FnIn int32 + FaInLoop uintptr + })(unsafe.Pointer(pLevel + 72))).FnIn == 0 { + (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt = _sqlite3VdbeMakeLabel(tls, pParse) + } + if iEq > 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IN_SEEKSCAN) == uint32(0) { + *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_EARLYOUT) + } + i = (*(*struct { + FnIn int32 + FaInLoop uintptr + })(unsafe.Pointer(pLevel + 72))).FnIn + (*(*struct { + FnIn int32 + FaInLoop uintptr + })(unsafe.Pointer(pLevel + 72))).FnIn += nEq + (*(*struct { + FnIn int32 + FaInLoop uintptr + })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { + FnIn int32 + FaInLoop uintptr + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + FnIn int32 + FaInLoop uintptr + })(unsafe.Pointer(pLevel + 72))).FnIn)) + pIn = (*(*struct { + FnIn int32 + FaInLoop uintptr + })(unsafe.Pointer(pLevel + 72))).FaInLoop + if pIn != 0 { + iMap = 0 /* Index in aiMap[] */ + pIn += uintptr(i) * 20 + i = iEq + for { + if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) { + break + } + if (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX { + iOut = iTarget + i - iEq + if eType == int32(IN_INDEX_ROWID) { + (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) + } else { + if aiMap != 0 { + v7 = iMap + iMap++ + v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + } else { + v6 = 0 + } + iCol = v6 + (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) + } + _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) + if i == iEq { + (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) + if bRev != 0 { + v8 = int32(OP_Prev) + } else { + v8 = int32(OP_Next) + } + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + if iEq > 0 { + (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i + (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i + } else { + (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = 0 + } + } else { + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = uint8(OP_Noop) + } + pIn += 20 + } + goto _5 + _5: + ; + i++ + } + if iEq > 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IN_SEEKSCAN)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { + _sqlite3VdbeAddOp3(tls, v, int32(OP_SeekHit), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, 0, iEq) + } + } else { + (*(*struct { + FnIn int32 + FaInLoop uintptr + })(unsafe.Pointer(pLevel + 72))).FnIn = 0 + } + _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) +} + +// C documentation +// +// /* // ** Generate code for a single equality term of the WHERE clause. An equality // ** term can be either X=expr or X IN (...). pTerm is the term to be // ** coded. @@ -132696,181 +133876,19 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p // ** 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) (r int32) { - bp := tls.Alloc(16) - defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, iReg, n, nEq, v3, v4, v6, v7, v8 int32 - var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, iReg, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 - pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Register holding results */ + var iReg int32 + var pX uintptr + _, _ = iReg, pX + pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr /* Register holding results */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_EQ) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_IS) { iReg = _sqlite3ExprCodeTarget(tls, pParse, (*TExpr)(unsafe.Pointer(pX)).FpRight, iTarget) } else { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pX)).Fop) == int32(TK_ISNULL) { iReg = iTarget - _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, iReg) + _sqlite3VdbeAddOp2(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Null), 0, iReg) } else { - eType = int32(IN_INDEX_NOOP) - pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - nEq = 0 - aiMap = uintptr(0) - if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_VIRTUALTABLE) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex != uintptr(0) && *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex)).FaSortOrder + uintptr(iEq))) != 0 { - bRev = libc.BoolInt32(!(bRev != 0)) - } iReg = iTarget - i = 0 - for { - if !(i < iEq) { - break - } - if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX { - _disableTerm(tls, pLevel, pTerm) - return iTarget - } - goto _1 - _1: - ; - i++ - } - i = iEq - for { - if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) { - break - } - if (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX { - nEq++ - } - goto _2 - _2: - ; - i++ - } - *(*int32)(unsafe.Pointer(bp)) = 0 - if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) - } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - } - pX = pExpr - } - if eType == int32(IN_INDEX_INDEX_DESC) { - bRev = libc.BoolInt32(!(bRev != 0)) - } - if bRev != 0 { - v4 = int32(OP_Last) - } else { - v4 = int32(OP_Rewind) - } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) - *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) - if (*(*struct { - FnIn int32 - FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn == 0 { - (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrNxt = _sqlite3VdbeMakeLabel(tls, pParse) - } - if iEq > 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IN_SEEKSCAN) == uint32(0) { - *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_EARLYOUT) - } - i = (*(*struct { - FnIn int32 - FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn - (*(*struct { - FnIn int32 - FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn += nEq - (*(*struct { - FnIn int32 - FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { - FnIn int32 - FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { - FnIn int32 - FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) - pIn = (*(*struct { - FnIn int32 - FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop - if pIn != 0 { - iMap = 0 /* Index in aiMap[] */ - pIn += uintptr(i) * 20 - i = iEq - for { - if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm)) { - break - } - if (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX { - iOut = iReg + i - iEq - if eType == int32(IN_INDEX_ROWID) { - (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) - } else { - if aiMap != 0 { - v7 = iMap - iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) - } else { - v6 = 0 - } - iCol = v6 - (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) - } - _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) - if i == iEq { - (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) - if bRev != 0 { - v8 = int32(OP_Prev) - } else { - v8 = int32(OP_Next) - } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) - if iEq > 0 { - (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iReg - i - (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i - } else { - (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = 0 - } - } else { - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = uint8(OP_Noop) - } - pIn += 20 - } - goto _5 - _5: - ; - i++ - } - if iEq > 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IN_SEEKSCAN)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { - _sqlite3VdbeAddOp3(tls, v, int32(OP_SeekHit), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, 0, iEq) - } - } else { - (*(*struct { - FnIn int32 - FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn = 0 - } - _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiMap) + _codeINTerm(tls, pParse, pTerm, pLevel, iEq, bRev, iTarget) } } /* As an optimization, try to disable the WHERE clause term that is @@ -132943,14 +133961,28 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Affinity string to return */ /* This module is only called on query plans that use an index. */ pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - nEq = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq + nEq = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq nSkip = (*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip - pIdx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex + pIdx = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex /* Figure out how many memory cells we will need then allocate them. */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 56)) += nReg + *(*int32)(unsafe.Pointer(pParse + 60)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -133234,7 +134266,14 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 _sqlite3VdbeAddOp2(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_MustBeInt), regRowid, addrNxt) _sqlite3VdbeAddOp4Int(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Filter), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, addrNxt, regRowid, int32(1)) } else { - nEq = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq + nEq = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq r1 = _codeAllEqualityTerms(tls, pParse, pLevel, 0, 0, bp) _codeApplyAffinity(tls, pParse, r1, libc.Int32FromUint16(nEq), *(*uintptr)(unsafe.Pointer(bp))) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(bp))) @@ -133255,10 +134294,38 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 func _whereLoopIsOneRow(tls *libc.TLS, pLoop uintptr) (r int32) { var ii int32 _ = ii - if (*TIndex)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex)).FonError != 0 && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) == 0 && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) == libc.Int32FromUint16((*TIndex)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex)).FnKeyCol) { + if (*TIndex)(unsafe.Pointer((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex)).FonError != 0 && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) == 0 && libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq) == libc.Int32FromUint16((*TIndex)(unsafe.Pointer((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex)).FnKeyCol) { ii = 0 for { - if !(ii < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) { + if !(ii < libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq)) { break } if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(ii)*8)))).FeOperator)&(libc.Int32FromInt32(WO_IS)|libc.Int32FromInt32(WO_ISNULL)) != 0 { @@ -133286,7 +134353,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI var aMoveOp [4]Tu8 var addrBrk, addrCont, addrExplain, addrHalt, addrNotFound, addrNxt, addrSeekScan, bRev, endEq, iCache, iCol, iCol1, iCovCur, iCur, iFld, iIdxCur, iIn, iLoop, iLoopBody, iNext, iPk, iPk1, iReg, iReleaseReg, iRetInit, iRowidReg, iSet, iTab, iTarget, iTerm, ii, j, jmp1, jmp11, k, memEndValue, nConstraint, nConstraint1, nExtraReg, nNotReady, nPk, nPk1, omitTable, op, op1, r, r1, r11, regBase, regBignull, regReturn, regRowid, regRowset, regYield, skipLikeAddr, start, startEq, start_constraints, testOp, untestedTerms, v1, v11, v13, v14, v2, v20, v23, v24, v25, v26, v27, v29, v3, v30, v31, v32, v34, v35, v36, v37, v38, v39, v4, v41, v43, v44, v46, v49, v51, v53, v58, v60, v9 int32 var bSeekPastNull, bStopAtNull, t1, t2 Tu8 - var db, origSrc, pAlt, pAndExpr, pCompare, pCov, pDelete, pE, pE1, pEnd, pExpr, pIdx, pLeft, pLoop, pOp, pOrExpr, pOrTab, pOrTerm, pOrWc, pPk, pPk1, pPk2, pPk3, pRJ, pRJ1, pRangeEnd, pRangeStart, pRight, pRight1, pRight2, pRight3, pStart, pSubLoop, pSubWInfo, pTab, pTab1, pTabItem, pTerm, pWC, pX, pX1, t, zEndAff, v10, v12, v19, v21, v22, v28, v33, v40, v45, v47, v5, v50, v52, v54, v57, p62, p64, p68 uintptr + var db, origSrc, pAlt, pAndExpr, pCompare, pCov, pDelete, pE, pE1, pEnd, pExpr, pIdx, pLeft, pLoop, pOp, pOrExpr, pOrTab, pOrTerm, pOrWc, pPk, pPk1, pPk2, pPk3, pRJ, pRJ1, pRangeEnd, pRangeStart, pRight, pRight1, pRight2, pRight3, pStart, pSubLoop, pSubWInfo, pSubq, pTab, pTab1, pTabItem, pTerm, pWC, pX, pX1, t, zEndAff, v10, v12, v19, v21, v22, v28, v33, v40, v45, v47, v5, v50, v52, v54, v57, p62, p64, p68 uintptr var m TBitmask var nBtm, nEq, nTop Tu16 var v16, v8 uint32 @@ -133294,14 +134361,14 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI var _ /* rTemp at bp+0 */ int32 var _ /* sEAlt at bp+16 */ TExpr var _ /* zStartAff at bp+8 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aMoveOp, addrBrk, addrCont, addrExplain, addrHalt, addrNotFound, addrNxt, addrSeekScan, bRev, bSeekPastNull, bStopAtNull, db, endEq, iCache, iCol, iCol1, iCovCur, iCur, iFld, iIdxCur, iIn, iLoop, iLoopBody, iNext, iPk, iPk1, iReg, iReleaseReg, iRetInit, iRowidReg, iSet, iTab, iTarget, iTerm, ii, j, jmp1, jmp11, k, m, memEndValue, nBtm, nConstraint, nConstraint1, nEq, nExtraReg, nNotReady, nPk, nPk1, nTop, omitTable, op, op1, origSrc, pAlt, pAndExpr, pCompare, pCov, pDelete, pE, pE1, pEnd, pExpr, pIdx, pLeft, pLoop, pOp, pOrExpr, pOrTab, pOrTerm, pOrWc, pPk, pPk1, pPk2, pPk3, pRJ, pRJ1, pRangeEnd, pRangeStart, pRight, pRight1, pRight2, pRight3, pStart, pSubLoop, pSubWInfo, pTab, pTab1, pTabItem, pTerm, pWC, pX, pX1, r, r1, r11, regBase, regBignull, regReturn, regRowid, regRowset, regYield, skipLikeAddr, start, startEq, start_constraints, t, t1, t2, testOp, untestedTerms, zEndAff, v1, v10, v11, v12, v13, v14, v16, v17, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v43, v44, v45, v46, v47, v49, v5, v50, v51, v52, v53, v54, v57, v58, v60, v8, v9, p62, p64, p68 /* Jump here to continue with next cycle */ - iRowidReg = 0 /* Rowid is stored in this register, if not zero */ - iReleaseReg = 0 /* Temp register to free before returning */ - pIdx = uintptr(0) /* Iteration of constraint generator loop */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aMoveOp, addrBrk, addrCont, addrExplain, addrHalt, addrNotFound, addrNxt, addrSeekScan, bRev, bSeekPastNull, bStopAtNull, db, endEq, iCache, iCol, iCol1, iCovCur, iCur, iFld, iIdxCur, iIn, iLoop, iLoopBody, iNext, iPk, iPk1, iReg, iReleaseReg, iRetInit, iRowidReg, iSet, iTab, iTarget, iTerm, ii, j, jmp1, jmp11, k, m, memEndValue, nBtm, nConstraint, nConstraint1, nEq, nExtraReg, nNotReady, nPk, nPk1, nTop, omitTable, op, op1, origSrc, pAlt, pAndExpr, pCompare, pCov, pDelete, pE, pE1, pEnd, pExpr, pIdx, pLeft, pLoop, pOp, pOrExpr, pOrTab, pOrTerm, pOrWc, pPk, pPk1, pPk2, pPk3, pRJ, pRJ1, pRangeEnd, pRangeStart, pRight, pRight1, pRight2, pRight3, pStart, pSubLoop, pSubWInfo, pSubq, pTab, pTab1, pTabItem, pTerm, pWC, pX, pX1, r, r1, r11, regBase, regBignull, regReturn, regRowid, regRowset, regYield, skipLikeAddr, start, startEq, start_constraints, t, t1, t2, testOp, untestedTerms, zEndAff, v1, v10, v11, v12, v13, v14, v16, v17, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v43, v44, v45, v46, v47, v49, v5, v50, v51, v52, v53, v54, v57, v58, v60, v8, v9, p62, p64, p68 /* Jump here to continue with next cycle */ + iRowidReg = 0 /* Rowid is stored in this register, if not zero */ + iReleaseReg = 0 /* Temp register to free before returning */ + pIdx = uintptr(0) /* Iteration of constraint generator loop */ pWC = pWInfo + 104 db = (*TParse)(unsafe.Pointer(pParse)).Fdb pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104 + pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 iCur = (*TSrcItem)(unsafe.Pointer(pTabItem)).FiCursor (*TWhereLevel)(unsafe.Pointer(pLevel)).FnotReady = notReady & ^_sqlite3WhereGetMask(tls, pWInfo+592, iCur) bRev = libc.Int32FromUint64((*TWhereInfo)(unsafe.Pointer(pWInfo)).FrevMask >> iLevel & uint64(1)) @@ -133328,7 +134395,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 56 + v5 = pParse + 60 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -133354,9 +134421,10 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } addrHalt = (*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(j)*104))).FaddrBrk /* Special case of a FROM clause subquery implemented as a co-routine */ - if int32(uint32(*(*uint16)(unsafe.Pointer(pTabItem + 60 + 4))&0x20>>5)) != 0 { - regYield = (*TSrcItem)(unsafe.Pointer(pTabItem)).FregReturn - _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, (*TSrcItem)(unsafe.Pointer(pTabItem)).FaddrFillSub) + if int32(*(*uint32)(unsafe.Pointer(pTabItem + 24 + 4))&0x40>>6) != 0 { + pSubq = *(*uintptr)(unsafe.Pointer(pTabItem + 72)) + regYield = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn + _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub) (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = _sqlite3VdbeAddOp2(tls, v, int32(OP_Yield), regYield, addrBrk) (*TWhereLevel)(unsafe.Pointer(pLevel)).Fop = uint8(OP_Goto) } else { @@ -133388,11 +134456,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 52 + v10 = pParse + 56 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 56 + v12 = pParse + 60 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -133561,7 +134629,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 56 + v21 = pParse + 60 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -133641,7 +134709,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 56 + v28 = pParse + 60 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -133675,7 +134743,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 56 + v33 = pParse + 60 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -133685,18 +134753,46 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_INDEXED) != 0 { - nEq = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq /* Number of == or IN terms */ - nBtm = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm /* Length of BTM vector */ - nTop = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop /* Base register holding constraint values */ - pRangeStart = uintptr(0) /* Inequality constraint at range start */ - pRangeEnd = uintptr(0) /* The VDBE cursor for the index */ - nExtraReg = 0 /* Affinity for start of range constraint */ - zEndAff = uintptr(0) /* Affinity for end of range constraint */ - bSeekPastNull = uint8(0) /* True to seek past initial nulls */ - bStopAtNull = uint8(0) /* True if we use the index only */ - regBignull = 0 /* big-null flag register */ - addrSeekScan = 0 /* Opcode of the OP_SeekScan, if any */ - pIdx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex + nEq = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq /* Number of == or IN terms */ + nBtm = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnBtm /* Length of BTM vector */ + nTop = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnTop /* Base register holding constraint values */ + pRangeStart = uintptr(0) /* Inequality constraint at range start */ + pRangeEnd = uintptr(0) /* The VDBE cursor for the index */ + nExtraReg = 0 /* Affinity for start of range constraint */ + zEndAff = uintptr(0) /* Affinity for end of range constraint */ + bSeekPastNull = uint8(0) /* True to seek past initial nulls */ + bStopAtNull = uint8(0) /* True if we use the index only */ + regBignull = 0 /* big-null flag register */ + addrSeekScan = 0 /* Opcode of the OP_SeekScan, if any */ + pIdx = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur /* Find any inequality constraint terms for the start and end ** of the range. @@ -133706,10 +134802,24 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI v34 = j j++ pRangeStart = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(v34)*8)) - if nExtraReg > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm) { + if nExtraReg > libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnBtm) { v35 = nExtraReg } else { - v35 = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm) + v35 = libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnBtm) } nExtraReg = v35 /* Like optimization range constraints always occur in pairs */ @@ -133718,10 +134828,24 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI v36 = j j++ pRangeEnd = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(v36)*8)) - if nExtraReg > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop) { + if nExtraReg > libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnTop) { v37 = nExtraReg } else { - v37 = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop) + v37 = libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnTop) } nExtraReg = v37 if pRangeStart == uintptr(0) { @@ -133741,7 +134865,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 56 + v40 = pParse + 60 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -133991,11 +135115,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 52 + v45 = pParse + 56 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 56 + v47 = pParse + 60 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -134004,7 +135128,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI iLoopBody = _sqlite3VdbeMakeLabel(tls, pParse) /* Address of regReturn init */ untestedTerms = 0 /* Loop counter */ pAndExpr = uintptr(0) /* An ".. AND (...)" expression */ - pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpTab + pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) pOrWc = *(*uintptr)(unsafe.Pointer(pTerm + 32)) (*TWhereLevel)(unsafe.Pointer(pLevel)).Fop = uint8(OP_Return) @@ -134015,20 +135139,20 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(112)+libc.Uint64FromInt32(nNotReady)*uint64(104)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) if pOrTab == uintptr(0) { return notReady } (*TSrcList)(unsafe.Pointer(pOrTab)).FnAlloc = uint32(libc.Uint8FromInt32(nNotReady + libc.Int32FromInt32(1))) (*TSrcList)(unsafe.Pointer(pOrTab)).FnSrc = libc.Int32FromUint32((*TSrcList)(unsafe.Pointer(pOrTab)).FnAlloc) - libc.Xmemcpy(tls, pOrTab+8, pTabItem, uint64(104)) + libc.Xmemcpy(tls, pOrTab+8, pTabItem, uint64(80)) origSrc = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 k = int32(1) for { if !(k <= nNotReady) { break } - libc.Xmemcpy(tls, pOrTab+8+uintptr(k)*104, origSrc+uintptr((*(*TWhereLevel)(unsafe.Pointer(pLevel + uintptr(k)*104))).FiFrom)*104, uint64(104)) + libc.Xmemcpy(tls, pOrTab+8+uintptr(k)*80, origSrc+uintptr((*(*TWhereLevel)(unsafe.Pointer(pLevel + uintptr(k)*104))).FiFrom)*80, uint64(80)) goto _48 _48: ; @@ -134051,21 +135175,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 56 + v50 = pParse + 60 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 52 + v52 = pParse + 56 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 56 + v54 = pParse + 60 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -134138,7 +135262,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22410, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22491, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -134161,7 +135285,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22425, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22506, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -134251,8 +135375,29 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** be available. */ pSubLoop = (*(*TWhereLevel)(unsafe.Pointer(pSubWInfo + 856))).FpWLoop - if (*TWhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags&uint32(WHERE_INDEXED) != uint32(0) && (ii == 0 || (*TWhereLoop)(unsafe.Pointer(pSubLoop)).Fu.Fbtree.FpIndex == pCov) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pSubLoop)).Fu.Fbtree.FpIndex + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY))) { - pCov = (*TWhereLoop)(unsafe.Pointer(pSubLoop)).Fu.Fbtree.FpIndex + if (*TWhereLoop)(unsafe.Pointer(pSubLoop)).FwsFlags&uint32(WHERE_INDEXED) != uint32(0) && (ii == 0 || (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pSubLoop + 24))).FpIndex == pCov) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pSubLoop + 24))).FpIndex + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY))) { + pCov = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pSubLoop + 24))).FpIndex } else { pCov = uintptr(0) } @@ -134295,7 +135440,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI _disableTerm(tls, pLevel, pTerm) } } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pTabItem + 60 + 4))&0x40>>6)) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pTabItem + 24 + 4))&0x80>>7) != 0 { /* Tables marked isRecursive have only a single row that is stored in ** a pseudo-cursor. No need to Rewind or Next such cursors. */ (*TWhereLevel)(unsafe.Pointer(pLevel)).Fop = uint8(OP_Noop) @@ -134468,7 +135613,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** least once. This is accomplished by storing the PK for the row in ** both the iMatch index and the regBloom Bloom filter. */ - pTab1 = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104))).FpTab + pTab1 = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80))).FpSTab if (*TTable)(unsafe.Pointer(pTab1)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { r1 = _sqlite3GetTempRange(tls, pParse, int32(2)) _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab1, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, -int32(1), r1+int32(1)) @@ -134625,31 +135770,32 @@ var _aStart = [2]Tu8{ // ** for a RIGHT JOIN. // */ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLevel uintptr) { - bp := tls.Alloc(128) - defer tls.Free(128) + bp := tls.Alloc(112) + defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ pSubWhere = uintptr(0) pWC = pWInfo + 104 pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop - pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104 + pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22434, libc.VaList(bp+120, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22515, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } - pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*104 + pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf - if int32(uint32(*(*uint16)(unsafe.Pointer(pRight + 60 + 4))&0x20>>5)) != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSrcItem)(unsafe.Pointer(pRight)).FregResult, (*TSrcItem)(unsafe.Pointer(pRight)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pRight)).FpSelect)).FpEList)).FnExpr-int32(1)) + if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { + pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) } _sqlite3VdbeAddOp1(tls, v, int32(OP_NullRow), (*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiTabCur) iIdxCur = (*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiIdxCur @@ -134687,25 +135833,25 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint64(104)) + libc.Xmemcpy(tls, bp+8, pTabItem, uint64(80)) (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 56 + v4 = pParse + 60 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 addrCont = _sqlite3WhereContinueLabel(tls, pSubWInfo) - pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpTab + pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iCur, -int32(1), r) nPk = int32(1) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 56)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -134819,7 +135965,13 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r // ** "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL" // */ func _allowedOp(tls *libc.TLS, op int32) (r int32) { - return libc.BoolInt32(op == int32(TK_IN) || op >= int32(TK_EQ) && op <= int32(TK_GE) || op == int32(TK_ISNULL) || op == int32(TK_IS)) + if op > int32(TK_GE) { + return 0 + } + if op >= int32(TK_EQ) { + return int32(1) + } + return libc.BoolInt32(op == int32(TK_IN) || op == int32(TK_ISNULL) || op == int32(TK_IS)) } // C documentation @@ -134851,16 +136003,16 @@ func _exprCommute(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r Tu16) { func _operatorMask(tls *libc.TLS, op int32) (r Tu16) { var c Tu16 _ = c - if op == int32(TK_IN) { - c = uint16(WO_IN) + if op >= int32(TK_EQ) { + c = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ) << (op - libc.Int32FromInt32(TK_EQ))) } else { - if op == int32(TK_ISNULL) { - c = uint16(WO_ISNULL) + if op == int32(TK_IN) { + c = uint16(WO_IN) } else { - if op == int32(TK_IS) { - c = uint16(WO_IS) + if op == int32(TK_ISNULL) { + c = uint16(WO_ISNULL) } else { - c = libc.Uint16FromInt32(libc.Int32FromInt32(WO_EQ) << (op - libc.Int32FromInt32(TK_EQ))) + c = uint16(WO_IS) } } } @@ -134882,13 +136034,14 @@ func _operatorMask(tls *libc.TLS, op int32) (r Tu16) { // ** the operator. // */ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintptr, pisComplete uintptr, pnoCase uintptr) (r int32) { - bp := tls.Alloc(16) - defer tls.Free(16) + bp := tls.Alloc(32) + defer tls.Free(32) var c, v1 Tu8 var cnt, iCol, iFrom, iTo, isNum, op, r1, rc, v3, v4 int32 var db, pLeft, pList, pPrefix, pReprepare, pRight, pVal, v, z, zNew uintptr - var _ /* rDummy at bp+8 */ float64 + var _ /* rDummy at bp+16 */ float64 var _ /* wc at bp+0 */ [4]Tu8 + var _ /* z2 at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, cnt, db, iCol, iFrom, iTo, isNum, op, pLeft, pList, pPrefix, pReprepare, pRight, pVal, r1, rc, v, z, zNew, v1, v3, v4 z = uintptr(0) /* Wildcard characters */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Database connection */ @@ -134914,7 +136067,12 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt } } if z != 0 { - /* Count the number of prefix characters prior to the first wildcard */ + /* Count the number of prefix bytes prior to the first wildcard, + ** U+fffd character, or malformed utf-8. If the underlying database + ** has a UTF16LE encoding, then only consider ASCII characters. Note that + ** the encoding of z[] is UTF8 - we are dealing with only UTF8 here in this + ** code, but the database engine itself might be processing content using a + ** different encoding. */ cnt = 0 for { v1 = *(*Tu8)(unsafe.Pointer(z + uintptr(cnt))) @@ -134923,8 +136081,18 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt break } cnt++ - if libc.Int32FromUint8(c) == libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)]) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt)))) != 0 { + if libc.Int32FromUint8(c) == libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)]) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt)))) > 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt)))) < int32(0x80) { cnt++ + } else { + if libc.Int32FromUint8(c) >= int32(0x80) { + *(*uintptr)(unsafe.Pointer(bp + 8)) = z + uintptr(cnt) - uintptr(1) + if libc.Int32FromUint8(c) == int32(0xff) || _sqlite3Utf8Read(tls, bp+8) == uint32(0xfffd) || libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) == int32(SQLITE_UTF16LE) { + cnt-- + break + } else { + cnt = int32(int64(*(*uintptr)(unsafe.Pointer(bp + 8))) - int64(z)) + } + } } } /* The optimization is possible only if (1) the pattern does not begin @@ -134937,7 +136105,7 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt ** removed. */ if (cnt > int32(1) || cnt > 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z))) != libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[int32(3)])) && int32(255) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt-int32(1))))) { /* A "complete" match if the pattern ends with "*" or "%" */ - *(*int32)(unsafe.Pointer(pisComplete)) = libc.BoolInt32(libc.Int32FromUint8(c) == libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[0]) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt+int32(1))))) == 0) + *(*int32)(unsafe.Pointer(pisComplete)) = libc.BoolInt32(libc.Int32FromUint8(c) == libc.Int32FromUint8((*(*[4]Tu8)(unsafe.Pointer(bp)))[0]) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(cnt+int32(1))))) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) != int32(SQLITE_UTF16LE)) /* Get the pattern prefix. Remove all escapes from the prefix. */ pPrefix = _sqlite3Expr(tls, db, int32(TK_STRING), z) if pPrefix != 0 { @@ -134976,13 +136144,13 @@ func _isLikeOrGlob(tls *libc.TLS, pParse uintptr, pExpr uintptr, ppPrefix uintpt ** 2019-09-03 https://sqlite.org/src/info/0f0428096f17252a */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft)).Fop) != int32(TK_COLUMN) || libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pLeft)) != int32(SQLITE_AFF_TEXT) || (*TExpr)(unsafe.Pointer(pLeft)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)|libc.Int32FromInt32(EP_Subrtn)) == uint32(0) && *(*uintptr)(unsafe.Pointer(pLeft + 64)) != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 64)))).FeTabType) == int32(TABTYP_VTAB) { - isNum = _sqlite3AtoF(tls, zNew, bp+8, iTo, uint8(SQLITE_UTF8)) + isNum = _sqlite3AtoF(tls, zNew, bp+16, iTo, uint8(SQLITE_UTF8)) if isNum <= 0 { if iTo == int32(1) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zNew))) == int32('-') { isNum = +libc.Int32FromInt32(1) } else { *(*uint8)(unsafe.Pointer(zNew + uintptr(iTo-int32(1))))++ - isNum = _sqlite3AtoF(tls, zNew, bp+8, iTo, uint8(SQLITE_UTF8)) + isNum = _sqlite3AtoF(tls, zNew, bp+16, iTo, uint8(SQLITE_UTF8)) *(*uint8)(unsafe.Pointer(zNew + uintptr(iTo-int32(1))))-- } } @@ -135113,31 +136281,37 @@ func _isAuxiliaryVtabOperator(tls *libc.TLS, db uintptr, pExpr uintptr, peOp2 ui } } } else { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NE) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ISNOT) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL) { - res = 0 - pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft - pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_COLUMN) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 64)))).FeTabType) == int32(TABTYP_VTAB) { - res++ - } - if pRight != 0 && (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_COLUMN) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 64)))).FeTabType) == int32(TABTYP_VTAB)) { - res++ - t = pLeft - pLeft = pRight - pRight = t - } - *(*uintptr)(unsafe.Pointer(ppLeft)) = pLeft - *(*uintptr)(unsafe.Pointer(ppRight)) = pRight - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NE) { - *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_NE) - } - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ISNOT) { - *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOT) - } - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL) { - *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOTNULL) + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) >= int32(TK_EQ) { + /* Comparison operators are a common case. Save a few comparisons for + ** that common case by terminating early. */ + return 0 + } else { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NE) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ISNOT) || libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL) { + res = 0 + pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft + pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pLeft)).Fop) == int32(TK_COLUMN) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pLeft + 64)))).FeTabType) == int32(TABTYP_VTAB) { + res++ + } + if pRight != 0 && (libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_COLUMN) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pRight + 64)))).FeTabType) == int32(TABTYP_VTAB)) { + res++ + t = pLeft + pLeft = pRight + pRight = t + } + *(*uintptr)(unsafe.Pointer(ppLeft)) = pLeft + *(*uintptr)(unsafe.Pointer(ppRight)) = pRight + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NE) { + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_NE) + } + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_ISNOT) { + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOT) + } + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_NOTNULL) { + *(*uint8)(unsafe.Pointer(peOp2)) = uint8(SQLITE_INDEX_CONSTRAINT_ISNOTNULL) + } + return res } - return res } } return 0 @@ -135148,19 +136322,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16630, + FzOp: __ccgo_ts + 16695, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 15967, + FzOp: __ccgo_ts + 16029, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15446, + FzOp: __ccgo_ts + 15508, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22448, + FzOp: __ccgo_ts + 22529, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -135739,12 +136913,14 @@ func _exprSelectUsage(tls *libc.TLS, pMaskSet uintptr, pS uintptr) (r TBitmask) if !(i < (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) { break } - mask |= _exprSelectUsage(tls, pMaskSet, (*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104))).FpSelect) - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 60 + 4))&0x400>>10)) == 0 { - mask |= _sqlite3WhereExprUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 72))) + if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80 + 24 + 4))&0x4>>2) != 0 { + mask |= _exprSelectUsage(tls, pMaskSet, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80 + 72)))).FpSelect) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 60 + 4))&0x4>>2)) != 0 { - mask |= _sqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*104 + 88))) + if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80 + 24 + 4))&0x800>>11) == 0 { + mask |= _sqlite3WhereExprUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80 + 64))) + } + if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80 + 24 + 4))&0x8>>3) != 0 { + mask |= _sqlite3WhereExprListUsage(tls, pMaskSet, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(i)*80 + 48))) } goto _1 _1: @@ -135777,8 +136953,8 @@ func _exprMightBeIndexed2(tls *libc.TLS, pFrom uintptr, aiCurCol uintptr, pExpr var pIdx uintptr _, _, _, _ = i, iCur, pIdx, v1 for { - iCur = (*(*TSrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(j)*104))).FiCursor - pIdx = (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(j)*104))).FpTab)).FpIndex + iCur = (*(*TSrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(j)*80))).FiCursor + pIdx = (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(j)*80))).FpSTab)).FpIndex for { if !(pIdx != 0) { break @@ -135841,7 +137017,7 @@ func _exprMightBeIndexed(tls *libc.TLS, pFrom uintptr, aiCurCol uintptr, pExpr u if !(i < (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc) { break } - pIdx = (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(i)*104))).FpTab)).FpIndex + pIdx = (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pFrom + 8 + uintptr(i)*80))).FpSTab)).FpIndex for { if !(pIdx != 0) { break @@ -135886,7 +137062,6 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { bp := tls.Alloc(48) defer tls.Free(48) var c, v12 uint8 - var c1 Tu8 var db, pC, pDup, pExpr, pLeft, pLeft1, pLeft2, pLeft3, pList, pMaskSet, pNew, pNew1, pNewExpr, pNewExpr1, pNewExpr11, pNewExpr2, pNewExpr21, pNewTerm, pNewTerm1, pParse, pRight, pRight1, pStr2, pTerm, pWInfo, t, zCollSeqName, v13, p1, p10, p17, p20, p3, p4, p5, p6, p7, p9 uintptr var eExtraOp, opMask, wtFlags Tu16 var extraRight, prereqAll, prereqColumn, prereqExpr, prereqLeft, x TBitmask @@ -135899,7 +137074,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { var _ /* pLeft at bp+40 */ uintptr var _ /* pRight at bp+32 */ uintptr var _ /* pStr1 at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, c1, db, eExtraOp, extraRight, i, i1, i2, i3, idxNew, idxNew1, idxNew11, idxNew2, idxNew21, idxNew3, idxNew4, idxNew5, nLeft, op, opMask, pC, pDup, pExpr, pLeft, pLeft1, pLeft2, pLeft3, pList, pMaskSet, pNew, pNew1, pNewExpr, pNewExpr1, pNewExpr11, pNewExpr2, pNewExpr21, pNewTerm, pNewTerm1, pParse, pRight, pRight1, pStr2, pTerm, pWInfo, prereqAll, prereqColumn, prereqExpr, prereqLeft, res, t, wtFlags, x, zCollSeqName, v12, v13, v14, v15, v19, v2, p1, p10, p17, p20, p3, p4, p5, p6, p7, p9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, db, eExtraOp, extraRight, i, i1, i2, i3, idxNew, idxNew1, idxNew11, idxNew2, idxNew21, idxNew3, idxNew4, idxNew5, nLeft, op, opMask, pC, pDup, pExpr, pLeft, pLeft1, pLeft2, pLeft3, pList, pMaskSet, pNew, pNew1, pNewExpr, pNewExpr1, pNewExpr11, pNewExpr2, pNewExpr21, pNewTerm, pNewTerm1, pParse, pRight, pRight1, pStr2, pTerm, pWInfo, prereqAll, prereqColumn, prereqExpr, prereqLeft, res, t, wtFlags, x, zCollSeqName, v12, v13, v14, v15, v19, v2, p1, p10, p17, p20, p3, p4, p5, p6, p7, p9 pWInfo = (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo /* Prerequisites of pExpr */ extraRight = uint64(0) /* Extra dependencies on LEFT JOIN */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* RHS of LIKE/GLOB operator */ @@ -135947,7 +137122,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { 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>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22455, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22536, 0) return } } else { @@ -135959,7 +137134,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22455, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22536, 0) return } *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) @@ -136043,7 +137218,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8016 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8078 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -136123,7 +137298,6 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { /* Last character before the first wildcard */ pC = *(*uintptr)(unsafe.Pointer(pStr2 + 8)) + uintptr(_sqlite3Strlen30(tls, *(*uintptr)(unsafe.Pointer(pStr2 + 8)))-int32(1)) - c1 = *(*Tu8)(unsafe.Pointer(pC)) if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { /* The point is to increment the last character before the first ** wildcard. But if we increment '@', that will push it into the @@ -136131,15 +137305,21 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** inequality. To avoid this, make sure to also run the full ** LIKE on all candidate expressions by clearing the isComplete flag */ - if libc.Int32FromUint8(c1) == libc.Int32FromUint8('A')-libc.Int32FromInt32(1) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pC))) == libc.Int32FromUint8('A')-libc.Int32FromInt32(1) { *(*int32)(unsafe.Pointer(bp + 8)) = 0 } - c1 = _sqlite3UpperToLower[c1] + *(*Tu8)(unsafe.Pointer(pC)) = _sqlite3UpperToLower[*(*Tu8)(unsafe.Pointer(pC))] + } + /* Increment the value of the last utf8 character in the prefix. */ + for libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pC))) == int32(0xBF) && pC > *(*uintptr)(unsafe.Pointer(pStr2 + 8)) { + *(*Tu8)(unsafe.Pointer(pC)) = uint8(0x80) + pC-- } - *(*Tu8)(unsafe.Pointer(pC)) = libc.Uint8FromInt32(libc.Int32FromUint8(c1) + int32(1)) + /* isLikeOrGlob() guarantees this */ + *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22496 + v13 = __ccgo_ts + 22577 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -136335,7 +137515,7 @@ func _whereAddLimitExpr(tls *libc.TLS, pWC uintptr, iReg int32, pExpr uintptr, i pParse = (*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb *(*int32)(unsafe.Pointer(bp)) = 0 - if _sqlite3ExprIsInteger(tls, pExpr, bp) != 0 && *(*int32)(unsafe.Pointer(bp)) >= 0 { + if _sqlite3ExprIsInteger(tls, pExpr, bp, pParse) != 0 && *(*int32)(unsafe.Pointer(bp)) >= 0 { pVal = _sqlite3Expr(tls, db, int32(TK_INTEGER), uintptr(0)) if pVal == uintptr(0) { return @@ -136385,7 +137565,7 @@ func _sqlite3WhereAddLimit(tls *libc.TLS, pWC uintptr, p uintptr) { var pExpr, pOrderBy uintptr _, _, _, _ = iCsr, ii, pExpr, pOrderBy /* 1 -- checked by caller */ - if (*TSelect)(unsafe.Pointer(p)).FpGroupBy == uintptr(0) && (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(0) && ((*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc == int32(1) && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpTab)).FeTabType) == int32(TABTYP_VTAB)) { + if (*TSelect)(unsafe.Pointer(p)).FpGroupBy == uintptr(0) && (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(0) && ((*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc)).FnSrc == int32(1) && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB)) { pOrderBy = (*TSelect)(unsafe.Pointer(p)).FpOrderBy iCsr = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FiCursor /* Check condition (4). Return early if it is not met. */ @@ -136651,11 +137831,11 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC var joinType Tu32 var pArgs, pColRef, pRhs, pTab, pTerm uintptr _, _, _, _, _, _, _, _, _, _ = j, joinType, k, pArgs, pColRef, pRhs, pTab, pTerm, v2, v3 - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x4>>2)) == 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x8>>3) == 0 { return } - pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab - pArgs = *(*uintptr)(unsafe.Pointer(pItem + 88)) + pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab + pArgs = *(*uintptr)(unsafe.Pointer(pItem + 48)) if pArgs == uintptr(0) { return } @@ -136670,7 +137850,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22503, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22584, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -136682,7 +137862,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ (*TExpr)(unsafe.Pointer(pColRef)).FiColumn = int16(v3) *(*uintptr)(unsafe.Pointer(pColRef + 64)) = pTab - *(*TBitmask)(unsafe.Pointer(pItem + 80)) |= _sqlite3ExprColUsed(tls, pColRef) + *(*TBitmask)(unsafe.Pointer(pItem + 40)) |= _sqlite3ExprColUsed(tls, pColRef) pRhs = _sqlite3PExpr(tls, pParse, int32(TK_UPLUS), _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*(*TExprList_item)(unsafe.Pointer(pArgs + 8 + uintptr(j)*32))).FpExpr, 0), uintptr(0)) pTerm = _sqlite3PExpr(tls, pParse, int32(TK_EQ), pColRef, pRhs) if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) != 0 { @@ -137453,7 +138633,7 @@ func _isDistinctRedundant(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWC u return 0 } iBase = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FiCursor - pTab = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab + pTab = (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab /* 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. @@ -137635,13 +138815,71 @@ func _constraintCompatibleWithOuterJoin(tls *libc.TLS, pTerm uintptr, pSrc uintp // C documentation // // /* +// ** Return true if column iCol of table pTab seem like it might be a +// ** good column to use as part of a query-time index. +// ** +// ** Current algorithm (subject to improvement!): +// ** +// ** 1. If iCol is already the left-most column of some other index, +// ** then return false. +// ** +// ** 2. If iCol is part of an existing index that has an aiRowLogEst of +// ** more than 20, then return false. +// ** +// ** 3. If no disqualifying conditions above are found, return true. +// ** +// ** 2025-01-03: I experimented with a new rule that returns false if the +// ** the datatype of the column is "BOOLEAN". This did not improve +// ** performance on any queries at hand, but it did burn CPU cycles, so the +// ** idea was not committed. +// */ +func _columnIsGoodIndexCandidate(tls *libc.TLS, pTab uintptr, iCol int32) (r int32) { + var j int32 + var pIdx uintptr + _, _ = j, pIdx + pIdx = (*TTable)(unsafe.Pointer(pTab)).FpIndex + for { + if !(pIdx != uintptr(0)) { + break + } + j = 0 + for { + if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)) { + break + } + if int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2))) == iCol { + if j == 0 { + return 0 + } + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x80>>7)) != 0 && int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(j+int32(1))*2))) > int32(20) { + return 0 + } + break + } + goto _2 + _2: + ; + j++ + } + goto _1 + _1: + ; + pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext + } + return int32(1) +} + +// C documentation +// +// /* // ** 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 TBitmask) (r int32) { var aff uint8 - _ = aff + var leftCol int32 + _, _ = aff, leftCol if (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { return 0 } @@ -137654,20 +138892,18 @@ func _termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady TBi if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight¬Ready != uint64(0) { return 0 } - if (*(*struct { + leftCol = (*(*struct { FleftColumn int32 FiField int32 - })(unsafe.Pointer(pTerm + 32))).FleftColumn < 0 { + })(unsafe.Pointer(pTerm + 32))).FleftColumn + if leftCol < 0 { return 0 } - aff = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpTab)).FaCol + uintptr((*(*struct { - FleftColumn int32 - FiField int32 - })(unsafe.Pointer(pTerm + 32))).FleftColumn)*16))).Faffinity + aff = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FaCol + uintptr(leftCol)*16))).Faffinity if !(_sqlite3IndexAffinityOk(tls, (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr, aff) != 0) { return 0 } - return int32(1) + return _columnIsGoodIndexCandidate(tls, (*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab, leftCol) } // C documentation @@ -137680,19 +138916,19 @@ func _termCanDriveIndex(tls *libc.TLS, pTerm uintptr, pSrc uintptr, notReady TBi func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notReady TBitmask, pLevel uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - var addrCounter, addrInit, addrTop, i, iCol, iCol1, iContinue, mxBitCol, n, nKeyCol, regBase, regRecord, regYield, v12, v14, v3, v5 int32 + var addrCounter, addrInit, addrTop, i, iCol, iCol1, iContinue, mxBitCol, n, nKeyCol, regBase, regRecord, regYield, v13, v15, v3, v6 int32 var cMask, cMask1, extraCols, idxCols TBitmask - var pColl, pExpr, pIdx, pLoop, pPartial, pSrc, pTabList, pTable, pTerm, pWCEnd, pX, v, v13, v15, v9 uintptr + var pColl, pExpr, pIdx, pLoop, pPartial, pSrc, pSubq, pTabList, pTable, pTerm, pWCEnd, pX, v, v10, v14, v16 uintptr var sentWarning, useBloomFilter Tu8 - var v2, v8 uint64 + var v2, v9 uint64 var v4 Tu16 var _ /* zNotUsed at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCounter, addrInit, addrTop, cMask, cMask1, extraCols, i, iCol, iCol1, iContinue, idxCols, mxBitCol, n, nKeyCol, pColl, pExpr, pIdx, pLoop, pPartial, pSrc, pTabList, pTable, pTerm, pWCEnd, pX, regBase, regRecord, regYield, sentWarning, useBloomFilter, v, v12, v13, v14, v15, v2, v3, v4, v5, v8, v9 /* Bitmap of additional columns */ - sentWarning = uint8(0) /* True if a warning has been issued */ - useBloomFilter = uint8(0) /* True to also add a Bloom filter */ - pPartial = uintptr(0) /* Partial Index Expression */ - iContinue = 0 /* The FROM clause term to get the next index */ - addrCounter = 0 /* Array of registers where record is assembled */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCounter, addrInit, addrTop, cMask, cMask1, extraCols, i, iCol, iCol1, iContinue, idxCols, mxBitCol, n, nKeyCol, pColl, pExpr, pIdx, pLoop, pPartial, pSrc, pSubq, pTabList, pTable, pTerm, pWCEnd, pX, regBase, regRecord, regYield, sentWarning, useBloomFilter, v, v10, v13, v14, v15, v16, v2, v3, v4, v6, v9 /* Bitmap of additional columns */ + sentWarning = uint8(0) /* True if a warning has been issued */ + useBloomFilter = uint8(0) /* True to also add a Bloom filter */ + pPartial = uintptr(0) /* Partial Index Expression */ + iContinue = 0 /* The FROM clause term to get the next index */ + addrCounter = 0 /* Array of registers where record is assembled */ /* Generate code to skip over the creation and initialization of the ** transient index on 2nd and subsequent iterations of the loop. */ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe @@ -137701,8 +138937,8 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea ** and used to match WHERE clause constraints */ nKeyCol = 0 pTabList = (*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList - pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104 - pTable = (*TSrcItem)(unsafe.Pointer(pSrc)).FpTab + pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 + pTable = (*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab pWCEnd = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*TWhereClause)(unsafe.Pointer(pWC)).FnTerm)*56 pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop idxCols = uint64(0) @@ -137730,7 +138966,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<<libc.Int32FromInt32(8), __ccgo_ts+22539, libc.VaList(bp+16, (*TTable)(unsafe.Pointer(pTable)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTable)).FaCol + uintptr(iCol)*16))).FzCnName)) + Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<<libc.Int32FromInt32(8), __ccgo_ts+22620, libc.VaList(bp+16, (*TTable)(unsafe.Pointer(pTable)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTable)).FaCol + uintptr(iCol)*16))).FzCnName)) sentWarning = uint8(1) } if idxCols&cMask == uint64(0) { @@ -137750,7 +138986,14 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } v4 = libc.Uint16FromInt32(nKeyCol) (*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = v4 - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq = v4 + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq = v4 (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ) | libc.Int32FromInt32(WHERE_IDX_ONLY) | libc.Int32FromInt32(WHERE_INDEXED) | libc.Int32FromInt32(WHERE_AUTO_INDEX)) /* Count the number of additional columns needed to create a ** covering index. A "covering index" is an index that contains all @@ -137765,12 +139008,37 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } else { extraCols = (*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed & (^idxCols | libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1))) } + if !((*TTable)(unsafe.Pointer(pTable)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { + /* For WITHOUT ROWID tables, ensure that all PRIMARY KEY columns are + ** either in the idxCols mask or in the extraCols mask */ + i = 0 + for { + if !(i < int32((*TTable)(unsafe.Pointer(pTable)).FnCol)) { + break + } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTable)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) == 0 { + goto _5 + } + if i >= libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1) { + extraCols |= libc.Uint64FromInt32(1) << (libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) - libc.Int32FromInt32(1)) + break + } + if idxCols&(libc.Uint64FromInt32(1)<<i) != 0 { + goto _5 + } + extraCols |= libc.Uint64FromInt32(1) << i + goto _5 + _5: + ; + i++ + } + } if libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1) < int32((*TTable)(unsafe.Pointer(pTable)).FnCol) { - v5 = libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) - libc.Int32FromInt32(1) + v6 = libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) - libc.Int32FromInt32(1) } else { - v5 = int32((*TTable)(unsafe.Pointer(pTable)).FnCol) + v6 = int32((*TTable)(unsafe.Pointer(pTable)).FnCol) } - mxBitCol = v5 + mxBitCol = v6 i = 0 for { if !(i < mxBitCol) { @@ -137779,8 +139047,8 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea if extraCols&(libc.Uint64FromInt32(1)<<i) != 0 { nKeyCol++ } - goto _6 - _6: + goto _7 + _7: ; i++ } @@ -137788,12 +139056,19 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea nKeyCol += int32((*TTable)(unsafe.Pointer(pTable)).FnCol) - libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) + int32(1) } /* Construct the Index object to describe this index */ - pIdx = _sqlite3AllocateIndexObject(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int16(nKeyCol+int32(1)), 0, bp) + pIdx = _sqlite3AllocateIndexObject(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int16(nKeyCol+libc.BoolInt32((*TTable)(unsafe.Pointer(pTable)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0))), 0, bp) if pIdx == uintptr(0) { goto end_auto_index_create } - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex = pIdx - (*TIndex)(unsafe.Pointer(pIdx)).FzName = __ccgo_ts + 22565 + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex = pIdx + (*TIndex)(unsafe.Pointer(pIdx)).FzName = __ccgo_ts + 22646 (*TIndex)(unsafe.Pointer(pIdx)).FpTable = pTable n = 0 idxCols = uint64(0) @@ -137808,11 +139083,11 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea FiField int32 })(unsafe.Pointer(pTerm + 32))).FleftColumn if iCol1 >= libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - v8 = libc.Uint64FromInt32(1) << (libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) - libc.Int32FromInt32(1)) + v9 = libc.Uint64FromInt32(1) << (libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) - libc.Int32FromInt32(1)) } else { - v8 = libc.Uint64FromInt32(1) << iCol1 + v9 = libc.Uint64FromInt32(1) << iCol1 } - cMask1 = v8 + cMask1 = v9 if idxCols&cMask1 == uint64(0) { pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr idxCols |= cMask1 @@ -137823,11 +139098,11 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pX) /* TH3 collate01.800 */ if pColl != 0 { - v9 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName + v10 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v9 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) + v10 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } - *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = v9 + *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = v10 n++ if (*TExpr)(unsafe.Pointer(pX)).FpLeft != uintptr(0) && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft)) != int32(SQLITE_AFF_TEXT) { /* TUNING: only use a Bloom filter on an automatic index @@ -137839,8 +139114,8 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } } } - goto _7 - _7: + goto _8 + _8: ; pTerm += 56 } @@ -137856,8 +139131,8 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) n++ } - goto _10 - _10: + goto _11 + _11: ; i++ } @@ -137870,34 +139145,37 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = int16(i) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) n++ - goto _11 - _11: + goto _12 + _12: ; i++ } } - *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = int16(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) + if (*TTable)(unsafe.Pointer(pTable)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { + *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(n)*2)) = int16(-libc.Int32FromInt32(1)) + *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(n)*8)) = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) + } /* Create the automatic index */ - v13 = pParse + 52 - v12 = *(*int32)(unsafe.Pointer(v13)) - *(*int32)(unsafe.Pointer(v13))++ - (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = v12 + v14 = pParse + 56 + v13 = *(*int32)(unsafe.Pointer(v14)) + *(*int32)(unsafe.Pointer(v14))++ + (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur = v13 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenAutoindex), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, nKeyCol+int32(1)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pIdx) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) && useBloomFilter != 0 { _sqlite3WhereExplainBloomFilter(tls, pParse, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, pLevel) - v15 = pParse + 56 - *(*int32)(unsafe.Pointer(v15))++ - v14 = *(*int32)(unsafe.Pointer(v15)) - (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter = v14 + v16 = pParse + 60 + *(*int32)(unsafe.Pointer(v16))++ + v15 = *(*int32)(unsafe.Pointer(v16)) + (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter = v15 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(10000), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter) } /* Fill the automatic index with content */ - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x20>>5)) != 0 { - regYield = (*TSrcItem)(unsafe.Pointer(pSrc)).FregReturn + if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x40>>6) != 0 { + pSubq = *(*uintptr)(unsafe.Pointer(pSrc + 72)) + regYield = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn addrCounter = _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, 0) - _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, (*TSrcItem)(unsafe.Pointer(pSrc)).FaddrFillSub) + _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub) addrTop = _sqlite3VdbeAddOp1(tls, v, int32(OP_Yield), regYield) } else { addrTop = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur) @@ -137910,18 +139188,25 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea regRecord = _sqlite3GetTempReg(tls, pParse) regBase = _sqlite3GenerateIndexKey(tls, pParse, pIdx, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, regRecord, 0, uintptr(0), uintptr(0), 0) if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter != 0 { - _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, 0, regBase, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) + _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, 0, regBase, libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq)) } _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxInsert), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur, regRecord) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_USESEEKRESULT)) if pPartial != 0 { _sqlite3VdbeResolveLabel(tls, v, iContinue) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x20>>5)) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x40>>6) != 0 { _sqlite3VdbeChangeP2(tls, v, addrCounter, regBase+n) - _translateColumnToCopy(tls, pParse, addrTop, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (*TSrcItem)(unsafe.Pointer(pSrc)).FregResult, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur) + _translateColumnToCopy(tls, pParse, addrTop, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pSrc + 72)))).FregResult, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur) _sqlite3VdbeGoto(tls, v, addrTop) - libc.SetBitFieldPtr16Uint32(pSrc+60+4, libc.Uint32FromInt32(0), 5, 0x20) + libc.SetBitFieldPtr32Uint32(pSrc+24+4, libc.Uint32FromInt32(0), 6, 0x40) } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Next), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, addrTop+int32(1)) _sqlite3VdbeChangeP5(tls, v, uint16(SQLITE_STMTSTATUS_AUTOINDEX)) @@ -137975,7 +139260,7 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p _sqlite3WhereExplainBloomFilter(tls, pParse, pWInfo, pLevel) addrCont = _sqlite3VdbeMakeLabel(tls, pParse) iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter = v1 @@ -137989,8 +139274,8 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p */ pTabList = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList iSrc = libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) - pItem = pTabList + 8 + uintptr(iSrc)*104 - pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab + pItem = pTabList + 8 + uintptr(iSrc)*80 + pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab sz = _sqlite3LogEstToInt(tls, (*TTable)(unsafe.Pointer(pTab)).FnRowLogEst) if sz < uint64(10000) { sz = uint64(10000) @@ -138022,8 +139307,22 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter, 0, r1, int32(1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } else { - pIdx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex - n = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) + pIdx = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex + n = libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq) r11 = _sqlite3GetTempRange(tls, pParse, n) jj = 0 for { @@ -138053,7 +139352,7 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p break } pLevel = pWInfo + 856 + uintptr(iLevel)*104 - pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104 + pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) != 0 { continue } @@ -138081,59 +139380,95 @@ func _sqlite3ConstructBloomFilter(tls *libc.TLS, pWInfo uintptr, iLevel int32, p // C documentation // // /* +// ** Return term iTerm of the WhereClause passed as the first argument. Terms +// ** are numbered from 0 upwards, starting with the terms in pWC->a[], then +// ** those in pWC->pOuter->a[] (if any), and so on. +// */ +func _termFromWhereClause(tls *libc.TLS, pWC uintptr, iTerm int32) (r uintptr) { + var p uintptr + _ = p + p = pWC + for { + if !(p != 0) { + break + } + if iTerm < (*TWhereClause)(unsafe.Pointer(p)).FnTerm { + return (*TWhereClause)(unsafe.Pointer(p)).Fa + uintptr(iTerm)*56 + } + iTerm -= (*TWhereClause)(unsafe.Pointer(p)).FnTerm + goto _1 + _1: + ; + p = (*TWhereClause)(unsafe.Pointer(p)).FpOuter + } + return uintptr(0) +} + +// C documentation +// +// /* // ** 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 freeIndexInfo(). // */ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TBitmask, pSrc uintptr, pmNoOmit uintptr) (r uintptr) { - var eDistinct, i, j, n, nOrderBy, nTerm, v12, v2, v9 int32 + var eDistinct, i, iCol, j, n, nLast, nOrderBy, nTerm, v10, v14 int32 var mNoOmit, op Tu16 - var pE2, pExpr, pExpr1, pHidden, pIdxCons, pIdxInfo, pIdxOrderBy, pOrderBy, pParse, pTab, pTerm, pUsage, zColl, v6, p3, p4 uintptr - var v10 uint32 + var p, pE2, pExpr, pExpr1, pHidden, pIdxCons, pIdxInfo, pIdxOrderBy, pOrderBy, pParse, pPk, pTab, pTerm, pUsage, zColl, v6, p3, p4 uintptr + var v12 uint32 var v7 bool - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = eDistinct, i, j, mNoOmit, n, nOrderBy, nTerm, op, pE2, pExpr, pExpr1, pHidden, pIdxCons, pIdxInfo, pIdxOrderBy, pOrderBy, pParse, pTab, pTerm, pUsage, zColl, v10, v12, v2, v6, v7, v9, p3, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = eDistinct, i, iCol, j, mNoOmit, n, nLast, nOrderBy, nTerm, op, p, pE2, pExpr, pExpr1, pHidden, pIdxCons, pIdxInfo, pIdxOrderBy, pOrderBy, pParse, pPk, pTab, pTerm, pUsage, zColl, v10, v12, v14, v6, v7, p3, p4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse mNoOmit = uint16(0) eDistinct = 0 pOrderBy = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy - pTab = (*TSrcItem)(unsafe.Pointer(pSrc)).FpTab + pTab = (*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab /* Find all WHERE clause constraints referring to this virtual table. ** Mark each term with the TERM_OK flag. Set nTerm to the number of ** terms found. */ - v2 = libc.Int32FromInt32(0) - nTerm = v2 - i = v2 - pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + p = pWC + nTerm = libc.Int32FromInt32(0) for { - if !(i < (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm) { + if !(p != 0) { break } - p3 = pTerm + 18 - *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^libc.Int32FromInt32(TERM_OK)) - if (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { - goto _1 - } - if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUnusable != 0 { - goto _1 - } - if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & ^libc.Int32FromInt32(WO_EQUIV) == 0 { - goto _1 - } - if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) != 0 { - goto _1 - } - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 && !(_constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) { - goto _1 + i = 0 + pTerm = (*TWhereClause)(unsafe.Pointer(p)).Fa + for { + if !(i < (*TWhereClause)(unsafe.Pointer(p)).FnTerm) { + break + } + p3 = pTerm + 18 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) & ^libc.Int32FromInt32(TERM_OK)) + if (*TWhereTerm)(unsafe.Pointer(pTerm)).FleftCursor != (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor { + goto _2 + } + if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUnusable != 0 { + goto _2 + } + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & ^libc.Int32FromInt32(WO_EQUIV) == 0 { + goto _2 + } + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) != 0 { + goto _2 + } + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)|libc.Int32FromInt32(JT_RIGHT)) != 0 && !(_constraintCompatibleWithOuterJoin(tls, pTerm, pSrc) != 0) { + goto _2 + } + nTerm++ + p4 = pTerm + 18 + *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(TERM_OK)) + goto _2 + _2: + ; + i++ + pTerm += 56 } - nTerm++ - p4 = pTerm + 18 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(TERM_OK)) goto _1 _1: ; - i++ - pTerm += 56 + p = (*TWhereClause)(unsafe.Pointer(p)).FpOuter } /* If the ORDER BY clause contains only columns in the current ** virtual table then allocate space for the aOrderBy part of @@ -138188,7 +139523,7 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB } if i == n { nOrderBy = n - if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DISTINCTBY) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x4000>>14)) != 0) { + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DISTINCTBY) != 0 && !(int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x8000>>15) != 0) { eDistinct = int32(2) + libc.BoolInt32(libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_SORTBYGROUP) != 0) } else { if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_GROUPBY) != 0 { @@ -138201,7 +139536,7 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB */ pIdxInfo = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(96)+(libc.Uint64FromInt64(12)+libc.Uint64FromInt64(8))*libc.Uint64FromInt32(nTerm)+uint64(8)*libc.Uint64FromInt32(nOrderBy)+uint64(40)+uint64(8)*libc.Uint64FromInt32(nTerm)) if pIdxInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1632, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1633, 0) return uintptr(0) } pHidden = pIdxInfo + 1*96 @@ -138211,89 +139546,121 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint = pIdxCons (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaOrderBy = pIdxOrderBy (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage = pUsage + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FcolUsed = libc.Uint64FromInt64(libc.Int64FromUint64((*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed)) + if libc.BoolInt32((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0)) == 0 { + /* Ensure that all bits associated with PK columns are set. This is to + ** ensure they are available for cases like RIGHT joins or OR loops. */ + pPk = _sqlite3PrimaryKeyIndex(tls, pTab) + i = 0 + for { + if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { + break + } + iCol = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2))) + if iCol >= libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1) { + iCol = libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) - libc.Int32FromInt32(1) + } + *(*Tsqlite3_uint64)(unsafe.Pointer(pIdxInfo + 88)) |= libc.Uint64FromInt32(1) << iCol + goto _8 + _8: + ; + i++ + } + } (*THiddenIndexInfo1)(unsafe.Pointer(pHidden)).FpWC = pWC (*THiddenIndexInfo1)(unsafe.Pointer(pHidden)).FpParse = pParse (*THiddenIndexInfo1)(unsafe.Pointer(pHidden)).FeDistinct = eDistinct (*THiddenIndexInfo1)(unsafe.Pointer(pHidden)).FmIn = uint32(0) - v9 = libc.Int32FromInt32(0) - j = v9 - i = v9 - pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + p = pWC + v10 = libc.Int32FromInt32(0) + j = v10 + i = v10 for { - if !(i < (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm) { + if !(p != 0) { break } - if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_OK) == 0 { - goto _8 - } - (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).FiColumn = (*(*struct { - FleftColumn int32 - FiField int32 - })(unsafe.Pointer(pTerm + 32))).FleftColumn - (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).FiTermOffset = i - op = libc.Uint16FromInt32(libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & int32(WO_ALL)) - if libc.Int32FromUint16(op) == int32(WO_IN) { - if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_SLICE) == 0 { - if j <= int32(31) { - v10 = libc.Uint32FromInt32(1) << j - } else { - v10 = uint32(0) - } - *(*Tu32)(unsafe.Pointer(pHidden + 20)) |= v10 + nLast = i + (*TWhereClause)(unsafe.Pointer(p)).FnTerm + pTerm = (*TWhereClause)(unsafe.Pointer(p)).Fa + for { + if !(i < nLast) { + break } - op = uint16(WO_EQ) - } - if libc.Int32FromUint16(op) == int32(WO_AUX) { - (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = (*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp - } else { - if libc.Int32FromUint16(op)&(libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { - if libc.Int32FromUint16(op) == int32(WO_ISNULL) { - (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = uint8(SQLITE_INDEX_CONSTRAINT_ISNULL) - } else { - (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = uint8(SQLITE_INDEX_CONSTRAINT_IS) + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_OK) == 0 { + goto _11 + } + (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).FiColumn = (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FleftColumn + (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).FiTermOffset = i + op = libc.Uint16FromInt32(libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator) & int32(WO_ALL)) + if libc.Int32FromUint16(op) == int32(WO_IN) { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_SLICE) == 0 { + if j <= int32(31) { + v12 = libc.Uint32FromInt32(1) << j + } else { + v12 = uint32(0) + } + *(*Tu32)(unsafe.Pointer(pHidden + 20)) |= v12 } + op = uint16(WO_EQ) + } + if libc.Int32FromUint16(op) == int32(WO_AUX) { + (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = (*TWhereTerm)(unsafe.Pointer(pTerm)).FeMatchOp } else { - (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = uint8(op) - /* The direct assignment in the previous line is possible only because - ** the WO_ and SQLITE_INDEX_CONSTRAINT_ codes are identical. The - ** following asserts verify this fact. */ - if libc.Int32FromUint16(op)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0 && _sqlite3ExprIsVector(tls, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight) != 0 { - if j < int32(16) { - mNoOmit = Tu16(int32(mNoOmit) | libc.Int32FromInt32(1)<<j) - } - if libc.Int32FromUint16(op) == libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) { - (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = libc.Uint8FromInt32(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_LE) - libc.Int32FromInt32(TK_EQ))) + if libc.Int32FromUint16(op)&(libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { + if libc.Int32FromUint16(op) == int32(WO_ISNULL) { + (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = uint8(SQLITE_INDEX_CONSTRAINT_ISNULL) + } else { + (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = uint8(SQLITE_INDEX_CONSTRAINT_IS) } - if libc.Int32FromUint16(op) == libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) { - (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = libc.Uint8FromInt32(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_GE) - libc.Int32FromInt32(TK_EQ))) + } else { + (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = uint8(op) + /* The direct assignment in the previous line is possible only because + ** the WO_ and SQLITE_INDEX_CONSTRAINT_ codes are identical. The + ** following asserts verify this fact. */ + if libc.Int32FromUint16(op)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0 && _sqlite3ExprIsVector(tls, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight) != 0 { + if j < int32(16) { + mNoOmit = Tu16(int32(mNoOmit) | libc.Int32FromInt32(1)<<j) + } + if libc.Int32FromUint16(op) == libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) { + (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = libc.Uint8FromInt32(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_LE) - libc.Int32FromInt32(TK_EQ))) + } + if libc.Int32FromUint16(op) == libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) { + (*(*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons + uintptr(j)*12))).Fop = libc.Uint8FromInt32(libc.Int32FromInt32(WO_EQ) << (libc.Int32FromInt32(TK_GE) - libc.Int32FromInt32(TK_EQ))) + } } } } + j++ + goto _11 + _11: + ; + i++ + pTerm += 56 } - j++ - goto _8 - _8: + goto _9 + _9: ; - i++ - pTerm += 56 + p = (*TWhereClause)(unsafe.Pointer(p)).FpOuter } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint = j - v12 = libc.Int32FromInt32(0) - j = v12 - i = v12 + v14 = libc.Int32FromInt32(0) + j = v14 + i = v14 for { if !(i < nOrderBy) { break } pExpr1 = (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32))).FpExpr if _sqlite3ExprIsConstant(tls, uintptr(0), pExpr1) != 0 { - goto _11 + goto _13 } (*(*Tsqlite3_index_orderby)(unsafe.Pointer(pIdxOrderBy + uintptr(j)*8))).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr1)).FiColumn) (*(*Tsqlite3_index_orderby)(unsafe.Pointer(pIdxOrderBy + uintptr(j)*8))).Fdesc = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) j++ - goto _11 - _11: + goto _13 + _13: ; i++ } @@ -138305,6 +139672,19 @@ func _allocateIndexInfo(tls *libc.TLS, pWInfo uintptr, pWC uintptr, mUnusable TB // C documentation // // /* +// ** Free and zero the sqlite3_index_info.idxStr value if needed. +// */ +func _freeIdxStr(tls *libc.TLS, pIdxInfo uintptr) { + if (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr != 0 { + Xsqlite3_free(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = uintptr(0) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 0 + } +} + +// C documentation +// +// /* // ** Free an sqlite3_index_info structure allocated by allocateIndexInfo() // ** and possibly modified by xBestIndex methods. // */ @@ -138325,6 +139705,7 @@ func _freeIndexInfo(tls *libc.TLS, db uintptr, pIdxInfo uintptr) { ; i++ } + _freeIdxStr(tls, pIdxInfo) _sqlite3DbFree(tls, db, pIdxInfo) } @@ -138361,9 +139742,9 @@ func _vtabBestIndex(tls *libc.TLS, pParse uintptr, pTab uintptr, p uintptr) (r i _sqlite3OomFault(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) } else { if !((*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3859, libc.VaList(bp+8, _sqlite3ErrStr(tls, rc))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+8, _sqlite3ErrStr(tls, rc))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3859, libc.VaList(bp+8, (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+8, (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg)) } } } @@ -138618,8 +139999,22 @@ func _whereRangeSkipScanEst(tls *libc.TLS, pParse uintptr, pLower uintptr, pUppe var _ /* p2 at bp+8 */ uintptr var _ /* pVal at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aff, db, i, nAdjust, nDiff, nEq, nLower, nUpper, p, pColl, rc, res, res1, v1, p3 - p = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex - nEq = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) + p = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex + nEq = libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq) db = (*TParse)(unsafe.Pointer(pParse)).Fdb nLower = -int32(1) nUpper = (*TIndex)(unsafe.Pointer(p)).FnSample + int32(1) @@ -138748,15 +140143,43 @@ func _whereRangeScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pLower _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = iLower, iLwrIdx, iNew, iNew1, iUpper, iUprIdx, mask, mask1, nBtm, nEq, nNew, nOut, nTop, p, pExpr, pExpr1, rc, t, t1, v1, v2 rc = SQLITE_OK nOut = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnOut) - p = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex - nEq = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) + p = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex + nEq = libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq) if (*TIndex)(unsafe.Pointer(p)).FnSample > 0 && nEq < (*TIndex)(unsafe.Pointer(p)).FnSampleCol && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { if nEq == (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid { *(*uintptr)(unsafe.Pointer(bp)) = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec - nBtm = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnBtm) - nTop = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnTop) /* Rows less than the upper bound */ - iLwrIdx = -int32(2) /* aSample[] for the lower bound */ - iUprIdx = -int32(1) /* aSample[] for the upper bound */ + nBtm = libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnBtm) + nTop = libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnTop) /* Rows less than the upper bound */ + iLwrIdx = -int32(2) /* aSample[] for the lower bound */ + iUprIdx = -int32(1) /* aSample[] for the upper bound */ if *(*uintptr)(unsafe.Pointer(bp)) != 0 { (*TUnpackedRecord)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnField = libc.Uint16FromInt32((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid) } @@ -138902,8 +140325,22 @@ func _whereEqualScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pExpr u var _ /* bOk at bp+24 */ int32 var _ /* pRec at bp+0 */ uintptr _, _, _ = nEq, p, rc - p = (*TWhereLoop)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew)).Fu.Fbtree.FpIndex - nEq = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew)).Fu.Fbtree.FnEq) + p = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24))).FpIndex + nEq = libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24))).FnEq) *(*uintptr)(unsafe.Pointer(bp)) = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpRec /* If values are not available for all fields of the index to the left ** of this one, no estimate can be made. Return SQLITE_NOTFOUND. */ @@ -138957,7 +140394,14 @@ func _whereInScanEst(tls *libc.TLS, pParse uintptr, pBuilder uintptr, pList uint var p uintptr var _ /* nEst at bp+0 */ TtRowcnt _, _, _, _, _, _ = i, nRecValid, nRow0, nRowEst, p, rc - p = (*TWhereLoop)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew)).Fu.Fbtree.FpIndex + p = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew + 24))).FpIndex nRow0 = libc.Int64FromUint64(_sqlite3LogEstToInt(tls, *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(p)).FaiRowLogEst)))) nRecValid = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FnRecValid rc = SQLITE_OK /* Number of rows for a single term */ @@ -139024,10 +140468,38 @@ func _whereLoopClearUnion(tls *libc.TLS, db uintptr, p uintptr) { FmHandleIn Tu32 })(unsafe.Pointer(p + 24))).FidxStr = uintptr(0) } else { - if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&uint32(WHERE_AUTO_INDEX) != uint32(0) && (*TWhereLoop)(unsafe.Pointer(p)).Fu.Fbtree.FpIndex != uintptr(0) { - _sqlite3DbFree(tls, db, (*TIndex)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(p)).Fu.Fbtree.FpIndex)).FzColAff) - _sqlite3DbFreeNN(tls, db, (*TWhereLoop)(unsafe.Pointer(p)).Fu.Fbtree.FpIndex) - (*TWhereLoop)(unsafe.Pointer(p)).Fu.Fbtree.FpIndex = uintptr(0) + if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&uint32(WHERE_AUTO_INDEX) != uint32(0) && (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(p + 24))).FpIndex != uintptr(0) { + _sqlite3DbFree(tls, db, (*TIndex)(unsafe.Pointer((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(p + 24))).FpIndex)).FzColAff) + _sqlite3DbFreeNN(tls, db, (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(p + 24))).FpIndex) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(p + 24))).FpIndex = uintptr(0) } } } @@ -139092,7 +140564,14 @@ func _whereLoopXfer(tls *libc.TLS, db uintptr, pTo uintptr, pFrom uintptr) (r in libc.SetBitFieldPtr8Uint32(pFrom+24+4, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TWhereLoop)(unsafe.Pointer(pFrom)).FwsFlags&uint32(WHERE_AUTO_INDEX) != uint32(0) { - (*TWhereLoop)(unsafe.Pointer(pFrom)).Fu.Fbtree.FpIndex = uintptr(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pFrom + 24))).FpIndex = uintptr(0) } } return SQLITE_OK @@ -139138,7 +140617,7 @@ func _whereInfoFree(tls *libc.TLS, db uintptr, pWInfo uintptr) { // ** and Y has additional constraints that might speed the search that X lacks // ** but the cost of running X is not more than the cost of running Y. // ** -// ** In other words, return true if the cost relationwship between X and Y +// ** In other words, return true if the cost relationship between X and Y // ** is inverted and needs to be adjusted. // ** // ** Case 1: @@ -139163,7 +140642,35 @@ func _whereLoopCheaperProperSubset(tls *libc.TLS, pX uintptr, pY uintptr) (r int if int32((*TWhereLoop)(unsafe.Pointer(pX)).FrRun) > int32((*TWhereLoop)(unsafe.Pointer(pY)).FrRun) && int32((*TWhereLoop)(unsafe.Pointer(pX)).FnOut) > int32((*TWhereLoop)(unsafe.Pointer(pY)).FnOut) { return 0 } /* (1d) and (2a) */ - if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).Fu.Fbtree.FnEq) < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).Fu.Fbtree.FnEq) && (*TWhereLoop)(unsafe.Pointer(pX)).Fu.Fbtree.FpIndex == (*TWhereLoop)(unsafe.Pointer(pY)).Fu.Fbtree.FpIndex && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).FnSkip) == 0 && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).FnSkip) == 0 { + if libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pX + 24))).FnEq) < libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pY + 24))).FnEq) && (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pX + 24))).FpIndex == (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pY + 24))).FpIndex && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).FnSkip) == 0 && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).FnSkip) == 0 { return int32(1) /* Case 1 is true */ } if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).FnLTerm)-libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pX)).FnSkip) >= libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).FnLTerm)-libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pY)).FnSkip) { @@ -139441,9 +140948,23 @@ func _whereLoopInsert(tls *libc.TLS, pBuilder uintptr, pTemplate uintptr) (r int } rc = _whereLoopXfer(tls, db, p, pTemplate) if (*TWhereLoop)(unsafe.Pointer(p)).FwsFlags&uint32(WHERE_VIRTUALTABLE) == uint32(0) { - pIndex = (*TWhereLoop)(unsafe.Pointer(p)).Fu.Fbtree.FpIndex + pIndex = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(p + 24))).FpIndex if pIndex != 0 && int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_IPK) { - (*TWhereLoop)(unsafe.Pointer(p)).Fu.Fbtree.FpIndex = uintptr(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(p + 24))).FpIndex = uintptr(0) } } return rc @@ -139538,7 +141059,7 @@ func _whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow TLog ** are straight comparison operators that are non-true with NULL ** operand, or if the loop is not an OUTER JOIN. */ - if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(0x3f) != 0 || libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*104))).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) == 0 { + if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(0x3f) != 0 || libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_LTORJ)) == 0 { *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_SELFCULL) } } @@ -139554,7 +141075,7 @@ func _whereLoopOutputAdjust(tls *libc.TLS, pWC uintptr, pLoop uintptr, nRow TLog if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_IS)) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_HIGHTRUTH) == 0 { pRight = (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight *(*int32)(unsafe.Pointer(bp)) = 0 - if _sqlite3ExprIsInteger(tls, pRight, bp) != 0 && *(*int32)(unsafe.Pointer(bp)) >= -int32(1) && *(*int32)(unsafe.Pointer(bp)) <= int32(1) { + if _sqlite3ExprIsInteger(tls, pRight, bp, uintptr(0)) != 0 && *(*int32)(unsafe.Pointer(bp)) >= -int32(1) && *(*int32)(unsafe.Pointer(bp)) <= int32(1) { *(*int32)(unsafe.Pointer(bp)) = int32(10) } else { *(*int32)(unsafe.Pointer(bp)) = int32(20) @@ -139700,13 +141221,34 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x2>>1)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) } } - saved_nEq = (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq - saved_nBtm = (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm - saved_nTop = (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop + saved_nEq = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq + saved_nBtm = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnBtm + saved_nTop = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnTop saved_nSkip = (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip saved_nLTerm = (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm saved_wsFlags = (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags @@ -139745,9 +141287,30 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro *(*uint8)(unsafe.Pointer(p3)) = uint8(int32(*(*uint8)(unsafe.Pointer(p3))) | libc.Int32FromInt32(SQLITE_BLDF1_INDEXED)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = saved_wsFlags - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq = saved_nEq - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm = saved_nBtm - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = saved_nTop + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq = saved_nEq + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnBtm = saved_nBtm + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnTop = saved_nTop (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = saved_nLTerm if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm) >= libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLSlot) && _whereLoopResize(tls, db, pNew, libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)+int32(1)) != 0 { break /* OOM while trying to enlarge the pNew->aLTerm array */ @@ -139825,7 +141388,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro iCol = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiColumn + uintptr(saved_nEq)*2))) *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_COLUMN_EQ) if iCol == -int32(1) || iCol >= 0 && int32(nInMul) == 0 && libc.Int32FromUint16(saved_nEq) == libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol)-int32(1) { - if iCol == -int32(1) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x8>>3)) != 0 || libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) == int32(1) && (*TIndex)(unsafe.Pointer(pProbe)).FonError != 0 && libc.Int32FromUint16(eOp) == int32(WO_EQ) { + if iCol == -int32(1) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x8>>3)) != 0 || libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) == int32(1) && (*TIndex)(unsafe.Pointer(pProbe)).FonError != 0 && libc.Int32FromUint16(eOp)&int32(WO_EQ) != 0 { *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_ONEROW) } else { *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_UNQ_WANTED) @@ -139841,7 +141404,14 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro nVecLen = _whereRangeVectorLen(tls, pParse, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor, pProbe, libc.Int32FromUint16(saved_nEq), pTerm) if libc.Int32FromUint16(eOp)&(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ))|libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ))) != 0 { *(*Tu32)(unsafe.Pointer(pNew + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_RANGE) | libc.Int32FromInt32(WHERE_BTM_LIMIT)) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm = libc.Uint16FromInt32(nVecLen) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnBtm = libc.Uint16FromInt32(nVecLen) pBtm = pTerm pTop = uintptr(0) if libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_LIKEOPT) != 0 { @@ -139856,11 +141426,25 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro *(*Tu16)(unsafe.Pointer(v8))++ *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(v7)*8)) = pTop *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_TOP_LIMIT) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = uint16(1) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnTop = uint16(1) } } else { *(*Tu32)(unsafe.Pointer(pNew + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_RANGE) | libc.Int32FromInt32(WHERE_TOP_LIMIT)) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = libc.Uint16FromInt32(nVecLen) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnTop = libc.Uint16FromInt32(nVecLen) pTop = pTerm if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(WHERE_BTM_LIMIT) != uint32(0) { v9 = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm)-int32(2))*8)) @@ -139893,7 +141477,14 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro *(*TLogEst)(unsafe.Pointer(p13)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p13))) - nIn) } else { *(*TtRowcnt)(unsafe.Pointer(bp + 112)) = uint64(0) - if int32(nInMul) == 0 && (*TIndex)(unsafe.Pointer(pProbe)).FnSample != 0 && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) <= (*TIndex)(unsafe.Pointer(pProbe)).FnSampleCol && (libc.Int32FromUint16(eOp)&int32(WO_IN) == 0 || (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(EP_xIsSelect) == uint32(0)) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { + if int32(nInMul) == 0 && (*TIndex)(unsafe.Pointer(pProbe)).FnSample != 0 && libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq) <= (*TIndex)(unsafe.Pointer(pProbe)).FnSampleCol && (libc.Int32FromUint16(eOp)&int32(WO_IN) == 0 || (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).Fflags&uint32(EP_xIsSelect) == uint32(0)) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { pExpr1 = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint16(eOp)&(libc.Int32FromInt32(WO_EQ)|libc.Int32FromInt32(WO_ISNULL)|libc.Int32FromInt32(WO_IS)) != 0 { rc = _whereEqualScanEst(tls, pParse, pBuilder, (*TExpr)(unsafe.Pointer(pExpr1)).FpRight, bp+112) @@ -139953,7 +141544,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro ** under-estimate the scanning cost. */ rCostIdx = int16(int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnOut) + int32(16)) } else { - rCostIdx = int16(int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnOut) + int32(1) + int32(15)*int32((*TIndex)(unsafe.Pointer(pProbe)).FszIdxRow)/int32((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpTab)).FszTabRow)) + rCostIdx = int16(int32((*TWhereLoop)(unsafe.Pointer(pNew)).FnOut) + int32(1) + int32(15)*int32((*TIndex)(unsafe.Pointer(pProbe)).FszIdxRow)/int32((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FszTabRow)) } rCostIdx = _sqlite3LogEstAdd(tls, rLogSize, rCostIdx) /* Estimate the cost of running the loop. If all data is coming @@ -139978,8 +141569,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = nOutUnadjusted } - if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(WHERE_TOP_LIMIT) == uint32(0) && libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnColumn) && (libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { - if libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq) > int32(3) { + if (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags&uint32(WHERE_TOP_LIMIT) == uint32(0) && libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnColumn) && (libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq) < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pProbe)).FnKeyCol) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) != int32(SQLITE_IDXTYPE_PRIMARYKEY)) { + if libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq) > int32(3) { _sqlite3ProgressCheck(tls, pParse) } _whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(nInMul)+nIn)) @@ -139992,9 +141604,30 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro pTerm = _whereScanNext(tls, bp) } (*TWhereLoop)(unsafe.Pointer(pNew)).Fprereq = saved_prereq - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq = saved_nEq - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm = saved_nBtm - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = saved_nTop + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq = saved_nEq + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnBtm = saved_nBtm + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnTop = saved_nTop (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = saved_nSkip (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = saved_wsFlags (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut @@ -140014,7 +141647,14 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro rc = v21 } if v22 && v21 == SQLITE_OK { - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq++ + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq++ (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip++ v24 = pNew + 52 v23 = *(*Tu16)(unsafe.Pointer(v24)) @@ -140029,7 +141669,14 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro nIter = TLogEst(int32(nIter) + libc.Int32FromInt32(5)) _whereLoopAddBtreeIndex(tls, pBuilder, pSrc, pProbe, int16(int32(nIter)+int32(nInMul))) (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = saved_nOut - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq = saved_nEq + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq = saved_nEq (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = saved_nSkip (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = saved_wsFlags } @@ -140133,9 +141780,6 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp } pWhere = (*TExpr)(unsafe.Pointer(pWhere)).FpRight } - if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_EnableQPSG) != 0 { - pParse = uintptr(0) - } i = 0 pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa for { @@ -140496,12 +142140,12 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in pNew = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew pWInfo = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo pTabList = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList - pSrc = pTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*104 - pTab = (*TSrcItem)(unsafe.Pointer(pSrc)).FpTab + pSrc = pTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*80 + pTab = (*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab pWC = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x2>>1)) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) != 0 { /* An INDEXED BY clause specifies a particular index to use */ - pProbe = *(*uintptr)(unsafe.Pointer(pSrc + 96)) + pProbe = *(*uintptr)(unsafe.Pointer(pSrc + 56)) } else { if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { pProbe = (*TTable)(unsafe.Pointer(pTab)).FpIndex @@ -140517,8 +142161,8 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in libc.SetBitFieldPtr16Uint32(bp+100, libc.Uint32FromInt32(SQLITE_IDXTYPE_IPK), 0, 0x3) (*(*[2]TLogEst)(unsafe.Pointer(bp + 160)))[0] = (*TTable)(unsafe.Pointer(pTab)).FnRowLogEst (*(*[2]TLogEst)(unsafe.Pointer(bp + 160)))[int32(1)] = 0 - pFirst = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpTab)).FpIndex - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x1>>0)) == 0 { + pFirst = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FpIndex + if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x1>>0) == 0 { /* The real indices of the table are only considered if the ** NOT INDEXED qualifier is omitted from the FROM clause */ (*(*TIndex)(unsafe.Pointer(bp))).FpNext = pFirst @@ -140528,7 +142172,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in } rSize = (*TTable)(unsafe.Pointer(pTab)).FnRowLogEst /* Automatic indexes */ - if !((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet != 0) && libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(libc.Int32FromInt32(WHERE_RIGHT_JOIN)|libc.Int32FromInt32(WHERE_OR_SUBCLAUSE)) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags&uint64(SQLITE_AutoIndex) != uint64(0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x2>>1)) != 0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x1>>0)) != 0) && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x8>>3)) != 0) && !(int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x40>>6)) != 0) && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + if !((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpOrSet != 0) && libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&(libc.Int32FromInt32(WHERE_RIGHT_JOIN)|libc.Int32FromInt32(WHERE_OR_SUBCLAUSE)) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).Fflags&uint64(SQLITE_AutoIndex) != uint64(0) && !(int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) != 0) && !(int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x1>>0) != 0) && !(int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x10>>4) != 0) && !(int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x80>>7) != 0) && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSrc)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { pWCEnd = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*TWhereClause)(unsafe.Pointer(pWC)).FnTerm)*56 rLogSize = _estLog(tls, rSize) pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa @@ -140540,9 +142184,23 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in goto _1 } if _termCanDriveIndex(tls, pTerm, pSrc, uint64(0)) != 0 { - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq = uint16(1) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq = uint16(1) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FpIndex = uintptr(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FpIndex = uintptr(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(1) *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm)) = pTerm /* TUNING: One-time cost for computing the automatic index is @@ -140595,16 +142253,52 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnEq = uint16(0) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnBtm = uint16(0) - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnEq = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnBtm = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FrSetup = 0 (*TWhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = rSize - (*TWhereLoop)(unsafe.Pointer(pNew)).Fu.Fbtree.FpIndex = pProbe + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FpIndex = pProbe + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FpOrderBy = uintptr(0) b = _indexMightHelpWithOrderBy(tls, pBuilder, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) /* The ONEPASS_DESIRED flags never occurs together with ORDER BY */ if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_IPK) { @@ -140631,6 +142325,19 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in */ (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = int16(int32(rSize) + int32(16) - int32(2)*libc.BoolInt32((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasStat4) != uint32(0))) _whereLoopOutputAdjust(tls, pWC, pNew, rSize) + if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x4>>2) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x40>>6) != 0 { + *(*Tu32)(unsafe.Pointer(pNew + 48)) |= uint32(WHERE_COROUTINE) + } + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FpOrderBy = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pSrc + 72)))).FpSelect)).FpOrderBy + } rc = _whereLoopInsert(tls, pBuilder, pNew) (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = rSize if rc != 0 { @@ -140663,7 +142370,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in } } /* Full scan via index */ - if b != 0 || !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) || (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0) || int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x2>>1)) != 0 || *(*TBitmask)(unsafe.Pointer(bp + 168)) == uint64(0) && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pProbe)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab)).FszTabRow) && libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_ONEPASS_DESIRED) == 0 && _sqlite3Config.FbUseCis != 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_CoverIdxScan)) == uint32(0) { + if b != 0 || !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) || (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere != uintptr(0) || int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) != 0 || *(*TBitmask)(unsafe.Pointer(bp + 168)) == uint64(0) && int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pProbe)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab)).FszTabRow) && libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_ONEPASS_DESIRED) == 0 && _sqlite3Config.FbUseCis != 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_CoverIdxScan)) == uint32(0) { if b != 0 { v6 = iSortIdx } else { @@ -140739,7 +142446,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in goto _4 _4: ; - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x2>>1)) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) != 0 { v8 = uintptr(0) } else { v8 = (*TIndex)(unsafe.Pointer(pProbe)).FpNext @@ -140809,17 +142516,18 @@ func _allConstraintsUsed(tls *libc.TLS, aUsage uintptr, nCons int32) (r int32) { func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUsable TBitmask, mExclude Tu16, pIdxInfo uintptr, mNoOmit Tu16, pbIn uintptr, pbRetryLimit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var i, iTerm, j, mxTerm, nConstraint, rc, v3, v7 int32 - var pHidden, pIdxCons, pNew, pParse, pSrc, pTerm, pTerm1, pUsage, pWC, p4 uintptr - var v5 uint32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = i, iTerm, j, mxTerm, nConstraint, pHidden, pIdxCons, pNew, pParse, pSrc, pTerm, pTerm1, pUsage, pWC, rc, v3, v5, v7, p4 + var i, iTerm, j, mxTerm, nConstraint, rc, v3, v9 int32 + var pHidden, pIdxCons, pNew, pParse, pSrc, pTerm, pTerm1, pUsage, pWC, v4, p6 uintptr + var v5 bool + var v7 uint32 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = i, iTerm, j, mxTerm, nConstraint, pHidden, pIdxCons, pNew, pParse, pSrc, pTerm, pTerm1, pUsage, pWC, rc, v3, v4, v5, v7, v9, p6 pWC = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC pHidden = pIdxInfo + 1*96 pUsage = (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage rc = SQLITE_OK pNew = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew pParse = (*TWhereInfo)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpParse - pSrc = (*TWhereInfo)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*104 + pSrc = (*TWhereInfo)(unsafe.Pointer((*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*80 nConstraint = (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint *(*int32)(unsafe.Pointer(pbIn)) = 0 (*TWhereLoop)(unsafe.Pointer(pNew)).Fprereq = mPrereq @@ -140831,7 +142539,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if !(i < nConstraint) { break } - pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset)*56 + pTerm = _termFromWhereClause(tls, pWC, (*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset) (*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(0) if (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight&mUsable == (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqRight && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&libc.Int32FromUint16(mExclude) == 0 && (pbRetryLimit != 0 || !(_isLimitTerm(tls, pTerm) != 0)) { (*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable = uint8(1) @@ -140850,16 +142558,16 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(1e+99) / libc.Float64FromInt32(2) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(25) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags = 0 - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FcolUsed = libc.Uint64FromInt64(libc.Int64FromUint64((*TSrcItem)(unsafe.Pointer(pSrc)).FcolUsed)) (*THiddenIndexInfo)(unsafe.Pointer(pHidden)).FmHandleIn = uint32(0) /* Invoke the virtual table xBestIndex() method */ - rc = _vtabBestIndex(tls, pParse, (*TSrcItem)(unsafe.Pointer(pSrc)).FpTab, pIdxInfo) + rc = _vtabBestIndex(tls, pParse, (*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab, pIdxInfo) if rc != 0 { if rc == int32(SQLITE_CONSTRAINT) { /* If the xBestIndex method returns SQLITE_CONSTRAINT, that means ** that the particular combination of parameters provided is unusable. ** Make no entries in the loop table. */ + _freeIdxStr(tls, pIdxInfo) return SQLITE_OK } return rc @@ -140877,11 +142585,15 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, iTerm = v3 if v3 >= 0 { j = (*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).FiTermOffset - if iTerm >= nConstraint || j < 0 || j >= (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22576, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName)) + if v5 = iTerm >= nConstraint || j < 0; !v5 { + v4 = _termFromWhereClause(tls, pWC, j) + pTerm1 = v4 + } + if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } - pTerm1 = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(j)*56 *(*TBitmask)(unsafe.Pointer(pNew)) |= (*TWhereTerm)(unsafe.Pointer(pTerm1)).FprereqRight *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) = pTerm1 if iTerm > mxTerm { @@ -140889,8 +142601,8 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, } if (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer(pUsage + uintptr(i)*8))).Fomit != 0 { if i < int32(16) && int32(1)<<i&libc.Int32FromUint16(mNoOmit) == 0 { - p4 = pNew + 24 + 6 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(1)<<iTerm) + p6 = pNew + 24 + 6 + *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(1)<<iTerm) } else { } if libc.Int32FromUint8((*TWhereTerm)(unsafe.Pointer(pTerm1)).FeMatchOp) == int32(SQLITE_INDEX_CONSTRAINT_OFFSET) { @@ -140898,11 +142610,11 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, } } if i <= int32(31) { - v5 = libc.Uint32FromInt32(1) << i + v7 = libc.Uint32FromInt32(1) << i } else { - v5 = uint32(0) + v7 = uint32(0) } - if v5&(*THiddenIndexInfo)(unsafe.Pointer(pHidden)).FmHandleIn != 0 { + if v7&(*THiddenIndexInfo)(unsafe.Pointer(pHidden)).FmHandleIn != 0 { (*(*struct { FidxNum int32 F__ccgo4 uint8 @@ -140933,11 +142645,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, ** the plan cannot be used. In these cases set variable *pbRetryLimit ** to true to tell the caller to retry with LIMIT and OFFSET ** disabled. */ - if (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr != 0 { - Xsqlite3_free(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = uintptr(0) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FneedToFreeIdxStr = 0 - } + _freeIdxStr(tls, pIdxInfo) *(*int32)(unsafe.Pointer(pbRetryLimit)) = int32(1) return SQLITE_OK } @@ -140957,11 +142665,12 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22576, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } - goto _6 - _6: + goto _8 + _8: ; i++ } @@ -140984,9 +142693,9 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, FmHandleIn Tu32 })(unsafe.Pointer(pNew + 24))).FidxStr = (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr if (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed != 0 { - v7 = (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy + v9 = (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnOrderBy } else { - v7 = 0 + v9 = 0 } (*(*struct { FidxNum int32 @@ -140995,7 +142704,8 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, FomitMask Tu16 FidxStr uintptr FmHandleIn Tu32 - })(unsafe.Pointer(pNew + 24))).FisOrdered = int8(v7) + })(unsafe.Pointer(pNew + 24))).FisOrdered = int8(v9) + libc.SetBitFieldPtr8Uint32(pNew+24+4, libc.BoolUint32((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxFlags&libc.Int32FromInt32(SQLITE_INDEX_SCAN_HEX) != libc.Int32FromInt32(0)), 2, 0x4) (*TWhereLoop)(unsafe.Pointer(pNew)).FrSetup = 0 (*TWhereLoop)(unsafe.Pointer(pNew)).FrRun = _sqlite3LogEstFromDouble(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost) (*TWhereLoop)(unsafe.Pointer(pNew)).FnOut = _sqlite3LogEst(tls, libc.Uint64FromInt64((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows)) @@ -141047,7 +142757,7 @@ func Xsqlite3_vtab_collation(tls *libc.TLS, pIdxInfo uintptr, iCons int32) (r ui if iCons >= 0 && iCons < (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { pC = uintptr(0) iTerm = (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset - pX = (*(*TWhereTerm)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer((*THiddenIndexInfo)(unsafe.Pointer(pHidden)).FpWC)).Fa + uintptr(iTerm)*56))).FpExpr + pX = (*TWhereTerm)(unsafe.Pointer(_termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pHidden)).FpWC, iTerm))).FpExpr if (*TExpr)(unsafe.Pointer(pX)).FpLeft != 0 { pC = _sqlite3ExprCompareCollSeq(tls, (*THiddenIndexInfo)(unsafe.Pointer(pHidden)).FpParse, pX) } @@ -141109,10 +142819,10 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(166464)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { - pTerm = (*TWhereClause)(unsafe.Pointer((*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC)).Fa + uintptr((*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset)*56 + pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) rc = _sqlite3ValueFromExpr(tls, (*TParse)(unsafe.Pointer((*THiddenIndexInfo)(unsafe.Pointer(pH)).FpParse)).Fdb, (*TExpr)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr)).FpRight, (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*THiddenIndexInfo)(unsafe.Pointer(pH)).FpParse)).Fdb)).Fenc, uint8(SQLITE_AFF_BLOB), pH+32+uintptr(iCons)*8) } pVal = *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) @@ -141207,21 +142917,21 @@ func _sqlite3VtabUsesAllSchemas(tls *libc.TLS, pParse uintptr) { func _whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUnusable TBitmask) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var i, nConstraint, rc, seenZero, seenZeroNoIN int32 + var i, iTerm, nConstraint, rc, seenZero, seenZeroNoIN int32 var mBest, mBestNoIn, mNext, mPrev, mThis, v1 TBitmask var p, pNew, pParse, pSrc, pWC, pWInfo uintptr var v2 bool var _ /* bIn at bp+0 */ int32 var _ /* bRetry at bp+8 */ int32 var _ /* mNoOmit at bp+4 */ Tu16 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = i, mBest, mBestNoIn, mNext, mPrev, mThis, nConstraint, p, pNew, pParse, pSrc, pWC, pWInfo, rc, seenZero, seenZeroNoIN, v1, v2 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = i, iTerm, mBest, mBestNoIn, mNext, mPrev, mThis, nConstraint, p, pNew, pParse, pSrc, pWC, pWInfo, rc, seenZero, seenZeroNoIN, v1, v2 rc = SQLITE_OK *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* True to retry with LIMIT/OFFSET disabled */ pWInfo = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWInfo pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse pWC = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpWC pNew = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew - pSrc = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*104 + pSrc = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*80 p = _allocateIndexInfo(tls, pWInfo, pWC, mUnusable, pSrc, bp+4) if p == uintptr(0) { return int32(SQLITE_NOMEM) @@ -141273,7 +142983,8 @@ func _whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUn if !(i < nConstraint) { break } - mThis = (*(*TWhereTerm)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(p)).FaConstraint + uintptr(i)*12))).FiTermOffset)*56))).FprereqRight & ^mPrereq + iTerm = (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(p)).FaConstraint + uintptr(i)*12))).FiTermOffset + mThis = (*TWhereTerm)(unsafe.Pointer(_termFromWhereClause(tls, pWC, iTerm))).FprereqRight & ^mPrereq if mThis > mPrev && mThis < mNext { mNext = mThis } @@ -141313,9 +143024,6 @@ func _whereLoopAddVirtual(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUn rc = _whereLoopAddVirtualOne(tls, pBuilder, mPrereq, mPrereq, uint16(WO_IN), p, *(*Tu16)(unsafe.Pointer(bp + 4)), bp, uintptr(0)) } } - if (*Tsqlite3_index_info)(unsafe.Pointer(p)).FneedToFreeIdxStr != 0 { - Xsqlite3_free(tls, (*Tsqlite3_index_info)(unsafe.Pointer(p)).FidxStr) - } _freeIndexInfo(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, p) return rc } @@ -141343,7 +143051,7 @@ func _whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUnusabl pWCEnd = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr((*TWhereClause)(unsafe.Pointer(pWC)).FnTerm)*56 pNew = (*TWhereLoopBuilder)(unsafe.Pointer(pBuilder)).FpNew libc.Xmemset(tls, bp+544, 0, uint64(56)) - pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*104 + pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pNew)).FiTab)*80 iCur = (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor /* The multi-index OR optimization does not work for RIGHT and FULL JOIN */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { @@ -141381,7 +143089,7 @@ func _whereLoopAddOr(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, mUnusabl } } (*(*TWhereOrSet)(unsafe.Pointer(bp + 600))).Fn = uint16(0) - if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FeTabType) == int32(TABTYP_VTAB) { + if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FeTabType) == int32(TABTYP_VTAB) { rc = _whereLoopAddVirtual(tls, bp+488, mPrereq, mUnusable) } else { rc = _whereLoopAddBtree(tls, bp+488, mPrereq) @@ -141482,7 +143190,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { mPrereq = uint64(0) mPrior = uint64(0) pTabList = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList - pEnd = pTabList + 8 + uintptr((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)*104 + pEnd = pTabList + 8 + uintptr((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)*80 db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb rc = SQLITE_OK bFirstPastRJ = 0 @@ -141522,8 +143230,8 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { mPrereq = uint64(0) } } - if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpTab)).FeTabType) == int32(TABTYP_VTAB) { - p = pItem + 1*104 + if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FeTabType) == int32(TABTYP_VTAB) { + p = pItem + 1*80 for { if !(p < pEnd) { break @@ -141534,7 +143242,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { goto _2 _2: ; - p += 104 + p += 80 } rc = _whereLoopAddVirtual(tls, pBuilder, mPrereq, mUnusable) } else { @@ -141547,7 +143255,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22602, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22683, 0) rc = SQLITE_OK } else { break @@ -141557,7 +143265,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { _1: ; iTab++ - pItem += 104 + pItem += 80 } _whereLoopClear(tls, db, pNew) return rc @@ -141565,6 +143273,122 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { // C documentation // +// /* Implementation of the order-by-subquery optimization: +// ** +// ** WhereLoop pLoop, which the iLoop-th term of the nested loop, is really +// ** a subquery or CTE that has an ORDER BY clause. See if any of the terms +// ** in the subquery ORDER BY clause will satisfy pOrderBy from the outer +// ** query. Mark off all satisfied terms (by setting bits in *pOBSat) and +// ** return TRUE if they do. If not, return false. +// ** +// ** Example: +// ** +// ** CREATE TABLE t1(a,b,c, PRIMARY KEY(a,b)); +// ** CREATE TABLE t2(x,y); +// ** WITH t3(p,q) AS MATERIALIZED (SELECT x+y, x-y FROM t2 ORDER BY x+y) +// ** SELECT * FROM t3 JOIN t1 ON a=q ORDER BY p, b; +// ** +// ** The CTE named "t3" comes out in the natural order of "p", so the first +// ** first them of "ORDER BY p,b" is satisfied by a sequential scan of "t3" +// ** and sorting only needs to occur on the second term "b". +// ** +// ** Limitations: +// ** +// ** (1) The optimization is not applied if the outer ORDER BY contains +// ** a COLLATE clause. The optimization might be applied if the +// ** outer ORDER BY uses NULLS FIRST, NULLS LAST, ASC, and/or DESC as +// ** long as the subquery ORDER BY does the same. But if the +// ** outer ORDER BY uses COLLATE, even a redundant COLLATE, the +// ** optimization is bypassed. +// ** +// ** (2) The subquery ORDER BY terms must exactly match subquery result +// ** columns, including any COLLATE annotations. This routine relies +// ** on iOrderByCol to do matching between order by terms and result +// ** columns, and iOrderByCol will not be set if the result column +// ** and ORDER BY collations differ. +// ** +// ** (3) The subquery and outer ORDER BY can be in opposite directions as +// ** long as the subquery is materialized. If the subquery is +// ** implemented as a co-routine, the sort orders must be in the same +// ** direction because there is no way to run a co-routine backwards. +// */ +func _wherePathMatchSubqueryOB(tls *libc.TLS, pWInfo uintptr, pLoop uintptr, iLoop int32, iCur int32, pOrderBy uintptr, pRevMask uintptr, pOBSat uintptr) (r int32) { + var iOB, jSub int32 + var pOBExpr, pSubOB uintptr + var rev, revIdx, sfOB, sfSub Tu8 + _, _, _, _, _, _, _, _ = iOB, jSub, pOBExpr, pSubOB, rev, revIdx, sfOB, sfSub /* Index into pSubOB->a[] */ + rev = uint8(0) /* True if iOB and jSub sort in opposite directions */ + revIdx = uint8(0) /* Complete ORDER BY on the subquery */ + pSubOB = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpOrderBy + iOB = 0 + for { + if !(libc.Uint64FromInt32(1)<<iOB&*(*TBitmask)(unsafe.Pointer(pOBSat)) != uint64(0)) { + break + } + goto _1 + _1: + ; + iOB++ + } + jSub = 0 + for { + if !(jSub < (*TExprList)(unsafe.Pointer(pSubOB)).FnExpr && iOB < (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr) { + break + } + if libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pSubOB + 8 + uintptr(jSub)*32 + 24))) == 0 { + break + } + pOBExpr = (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(iOB)*32))).FpExpr + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pOBExpr)).Fop) != int32(TK_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pOBExpr)).Fop) != int32(TK_AGG_COLUMN) { + break + } + if (*TExpr)(unsafe.Pointer(pOBExpr)).FiTable != iCur { + break + } + if int32((*TExpr)(unsafe.Pointer(pOBExpr)).FiColumn) != libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pSubOB + 8 + uintptr(jSub)*32 + 24)))-int32(1) { + break + } + if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_GROUPBY) == 0 { + sfOB = (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(iOB)*32))).Ffg.FsortFlags /* sortFlags for iOB */ + sfSub = (*(*TExprList_item)(unsafe.Pointer(pSubOB + 8 + uintptr(jSub)*32))).Ffg.FsortFlags /* sortFlags for jSub */ + if libc.Int32FromUint8(sfSub)&int32(KEYINFO_ORDER_BIGNULL) != libc.Int32FromUint8(sfOB)&int32(KEYINFO_ORDER_BIGNULL) { + break + } + revIdx = libc.Uint8FromInt32(libc.Int32FromUint8(sfSub) & int32(KEYINFO_ORDER_DESC)) + if jSub > 0 { + if libc.Int32FromUint8(rev)^libc.Int32FromUint8(revIdx) != libc.Int32FromUint8(sfOB)&int32(KEYINFO_ORDER_DESC) { + break + } + } else { + rev = libc.Uint8FromInt32(libc.Int32FromUint8(revIdx) ^ libc.Int32FromUint8(sfOB)&int32(KEYINFO_ORDER_DESC)) + if rev != 0 { + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_COROUTINE) != uint32(0) { + /* Cannot run a co-routine in reverse order */ + break + } + *(*TBitmask)(unsafe.Pointer(pRevMask)) |= libc.Uint64FromInt32(1) << iLoop + } + } + } + *(*TBitmask)(unsafe.Pointer(pOBSat)) |= libc.Uint64FromInt32(1) << iOB + goto _2 + _2: + ; + jSub++ + iOB++ + } + return libc.BoolInt32(jSub > 0) +} + +// C documentation +// // /* // ** Examine a WherePath (with the addition of the extra WhereLoop of the 6th // ** parameters) to see if it outputs rows in the requested ORDER BY @@ -141583,16 +143407,19 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { // ** pOrderBy terms must be matched in strict left-to-right order. // */ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pPath uintptr, wctrlFlags Tu16, nLoop Tu16, pLast uintptr, pRevMask uintptr) (r Ti8) { + bp := tls.Alloc(16) + defer tls.Free(16) var bOnce, distinctColumns, isMatch, isOrderDistinct, rev, revIdx, revSet, v5 Tu8 var db, p, pColl, pColl1, pColl2, pIndex, pIxExpr, pLoop, pOBExpr, pParse, pTerm, pX, v4 uintptr var eOp, eqOpMask, nColumn, nKeyCol, nOrderBy Tu16 var i, iColumn, iCur, iLoop, j int32 - var m, mTerm, obDone, obSat, orderDistinctMask, ready TBitmask + var m, mTerm, obDone, orderDistinctMask, ready TBitmask var v11 uint64 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bOnce, db, distinctColumns, eOp, eqOpMask, i, iColumn, iCur, iLoop, isMatch, isOrderDistinct, j, m, mTerm, nColumn, nKeyCol, nOrderBy, obDone, obSat, orderDistinctMask, p, pColl, pColl1, pColl2, pIndex, pIxExpr, pLoop, pOBExpr, pParse, pTerm, pX, ready, rev, revIdx, revSet, v11, v4, v5 /* A column number within table iCur */ - pLoop = uintptr(0) /* The index associated with pLoop */ - db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb /* Database connection */ - obSat = uint64(0) /* Mask of inner loops */ + var _ /* obSat at bp+0 */ TBitmask + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bOnce, db, distinctColumns, eOp, eqOpMask, i, iColumn, iCur, iLoop, isMatch, isOrderDistinct, j, m, mTerm, nColumn, nKeyCol, nOrderBy, obDone, orderDistinctMask, p, pColl, pColl1, pColl2, pIndex, pIxExpr, pLoop, pOBExpr, pParse, pTerm, pX, ready, rev, revIdx, revSet, v11, v4, v5 /* A column number within table iCur */ + pLoop = uintptr(0) /* The index associated with pLoop */ + db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb /* Database connection */ + *(*TBitmask)(unsafe.Pointer(bp)) = uint64(0) /* Mask of inner loops */ /* ** We say the WhereLoop is "one-row" if it generates no more than one ** row of output. A WhereLoop is one-row if all of the following are true: @@ -141631,7 +143458,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } iLoop = 0 for { - if !(isOrderDistinct != 0 && obSat < obDone && iLoop <= libc.Int32FromUint16(nLoop)) { + if !(isOrderDistinct != 0 && *(*TBitmask)(unsafe.Pointer(bp)) < obDone && iLoop <= libc.Int32FromUint16(nLoop)) { break } if iLoop > 0 { @@ -141654,15 +143481,22 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FisOrdered != 0 && libc.Int32FromUint16(wctrlFlags)&(libc.Int32FromInt32(WHERE_DISTINCTBY)|libc.Int32FromInt32(WHERE_SORTBYGROUP)) != int32(WHERE_DISTINCTBY) { - obSat = obDone + *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break } else { if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnDistinctCol = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) } } - iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*104))).FiCursor + iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).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 ** clause of the form X IS NULL or X=? that reference only outer @@ -141673,7 +143507,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, if !(i < libc.Int32FromUint16(nOrderBy)) { break } - if libc.Uint64FromInt32(1)<<i&obSat != 0 { + if libc.Uint64FromInt32(1)<<i&*(*TBitmask)(unsafe.Pointer(bp)) != 0 { goto _2 } pOBExpr = _sqlite3ExprSkipCollateAndLikely(tls, (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32))).FpExpr) @@ -141716,7 +143550,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, goto _2 } } - obSat |= libc.Uint64FromInt32(1) << i + *(*TBitmask)(unsafe.Pointer(bp)) |= libc.Uint64FromInt32(1) << i goto _2 _2: ; @@ -141724,11 +143558,30 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_ONEROW) == uint32(0) { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { + if (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpOrderBy != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OrderBySubq)) == uint32(0) && _wherePathMatchSubqueryOB(tls, pWInfo, pLoop, iLoop, iCur, pOrderBy, pRevMask, bp) != 0 { + nColumn = uint16(0) + isOrderDistinct = uint8(0) + } else { + nColumn = uint16(1) + } pIndex = uintptr(0) nKeyCol = uint16(0) - nColumn = uint16(1) } else { - v4 = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex + v4 = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex pIndex = v4 if v4 == uintptr(0) || int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x4>>2)) != 0 { return 0 @@ -141736,7 +143589,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, nKeyCol = (*TIndex)(unsafe.Pointer(pIndex)).FnKeyCol nColumn = (*TIndex)(unsafe.Pointer(pIndex)).FnColumn /* All relevant terms of the index must also be non-NULL in order - ** for isOrderDistinct to be true. So the isOrderDistint value + ** for isOrderDistinct to be true. So the isOrderDistinct value ** computed here might be a false positive. Corrections will be ** made at tag-20210426-1 below */ isOrderDistinct = libc.BoolUint8(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) != OE_None && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_SKIPSCAN) == uint32(0)) @@ -141755,7 +143608,14 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, break } bOnce = uint8(1) /* True to run the ORDER BY search loop */ - if j < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) && j >= libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { + if j < libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq) && j >= libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { eOp = (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8)))).FeOperator /* Skip over == and IS and ISNULL terms. (Also skip IN terms when ** doing WHERE_ORDERBY_LIMIT processing). Except, IS and ISNULL @@ -141783,7 +143643,14 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, pX = (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(j)*8)))).FpExpr i = j + int32(1) for { - if !(i < libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq)) { + if !(i < libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq)) { break } if (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)))).FpExpr == pX { @@ -141815,7 +143682,14 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, ** WhereLoop is not well-ordered. tag-20210426-1 */ if isOrderDistinct != 0 { - if iColumn >= 0 && j >= libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) && int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FpTable)).FaCol + uintptr(iColumn)*16 + 8))&0xf>>0)) == 0 { + if iColumn >= 0 && j >= libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq) && int32(uint32(*(*uint8)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FpTable)).FaCol + uintptr(iColumn)*16 + 8))&0xf>>0)) == 0 { isOrderDistinct = uint8(0) } if iColumn == -int32(2) { @@ -141823,7 +143697,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } } /* Find the ORDER BY term that corresponds to the j-th column - ** of the index and mark that ORDER BY term off + ** of the index and mark that ORDER BY term having been satisfied. */ isMatch = uint8(0) i = 0 @@ -141831,7 +143705,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, if !(bOnce != 0 && i < libc.Int32FromUint16(nOrderBy)) { break } - if libc.Uint64FromInt32(1)<<i&obSat != 0 { + if libc.Uint64FromInt32(1)<<i&*(*TBitmask)(unsafe.Pointer(bp)) != 0 { goto _8 } pOBExpr = _sqlite3ExprSkipCollateAndLikely(tls, (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32))).FpExpr) @@ -141864,7 +143738,14 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } } if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnDistinctCol = libc.Uint16FromInt32(j + int32(1)) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = libc.Uint16FromInt32(j + int32(1)) } isMatch = uint8(1) break @@ -141889,7 +143770,14 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, } } if isMatch != 0 && libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32))).Ffg.FsortFlags)&int32(KEYINFO_ORDER_BIGNULL) != 0 { - if j == libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq) { + if j == libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq) { *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_BIGNULL_SORT) } else { isMatch = uint8(0) @@ -141899,7 +143787,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, if iColumn == -int32(1) { distinctColumns = uint8(1) } - obSat |= libc.Uint64FromInt32(1) << i + *(*TBitmask)(unsafe.Pointer(bp)) |= libc.Uint64FromInt32(1) << i } else { /* No match found */ if j == 0 || j < libc.Int32FromUint16(nKeyCol) { @@ -141924,7 +143812,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, if !(i < libc.Int32FromUint16(nOrderBy)) { break } - if libc.Uint64FromInt32(1)<<i&obSat != 0 { + if libc.Uint64FromInt32(1)<<i&*(*TBitmask)(unsafe.Pointer(bp)) != 0 { goto _9 } p = (*(*TExprList_item)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32))).FpExpr @@ -141933,7 +143821,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, goto _9 } if mTerm & ^orderDistinctMask == uint64(0) { - obSat |= libc.Uint64FromInt32(1) << i + *(*TBitmask)(unsafe.Pointer(bp)) |= libc.Uint64FromInt32(1) << i } goto _9 _9: @@ -141946,7 +143834,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, ; iLoop++ } /* End the loop over all WhereLoops from outer-most down to inner-most */ - if obSat == obDone { + if *(*TBitmask)(unsafe.Pointer(bp)) == obDone { return libc.Int8FromUint16(nOrderBy) } if !(isOrderDistinct != 0) { @@ -141961,7 +143849,7 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, v11 = uint64(0) } m = v11 - if obSat&m == m { + if *(*TBitmask)(unsafe.Pointer(bp))&m == m { return int8(i) } goto _10 @@ -142049,6 +143937,231 @@ func _whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow TLogEst, nOrderBy int // C documentation // // /* +// ** Compute the maximum number of paths in the solver algorithm, for +// ** queries that have three or more terms in the FROM clause. Queries with +// ** two or fewer FROM clause terms are handled by the caller. +// ** +// ** Query planning is NP-hard. We must limit the number of paths at +// ** each step of the solver search algorithm to avoid exponential behavior. +// ** +// ** The value returned is a tuning parameter. Currently the value is: +// ** +// ** 18 for star queries +// ** 12 otherwise +// ** +// ** For the purposes of this heuristic, a star-query is defined as a query +// ** with a large central table that is joined using an INNER JOIN, +// ** not CROSS or OUTER JOINs, against four or more smaller tables. +// ** The central table is called the "fact" table. The smaller tables +// ** that get joined are "dimension tables". Also, any table that is +// ** self-joined cannot be a dimension table; we assume that dimension +// ** tables may only be joined against fact tables. +// ** +// ** SIDE EFFECT: (and really the whole point of this subroutine) +// ** +// ** If pWInfo describes a star-query, then the cost for SCANs of dimension +// ** WhereLoops is increased to be slightly larger than the cost of a SCAN +// ** in the fact table. Only SCAN costs are increased. SEARCH costs are +// ** unchanged. This heuristic helps keep fact tables in outer loops. Without +// ** this heuristic, paths with fact tables in outer loops tend to get pruned +// ** by the mxChoice limit on the number of paths, resulting in poor query +// ** plans. See the starschema1.test test module for examples of queries +// ** that need this heuristic to find good query plans. +// ** +// ** This heuristic can be completely disabled, so that no query is +// ** considered a star-query, using SQLITE_TESTCTRL_OPTIMIZATION to +// ** disable the SQLITE_StarQuery optimization. In the CLI, the command +// ** to do that is: ".testctrl opt -starquery". +// ** +// ** HISTORICAL NOTES: +// ** +// ** This optimization was first added on 2024-05-09 by check-in 38db9b5c83d. +// ** The original optimization reduced the cost and output size estimate for +// ** fact tables to help them move to outer loops. But months later (as people +// ** started upgrading) performance regression reports started caming in, +// ** including: +// ** +// ** forum post b18ef983e68d06d1 (2024-12-21) +// ** forum post 0025389d0860af82 (2025-01-14) +// ** forum post d87570a145599033 (2025-01-17) +// ** +// ** To address these, the criteria for a star-query was tightened to exclude +// ** cases where the fact and dimensions are separated by an outer join, and +// ** the affect of star-schema detection was changed to increase the rRun cost +// ** on just full table scans of dimension tables, rather than reducing costs +// ** in the all access methods of the fact table. +// */ +func _computeMxChoice(tls *libc.TLS, pWInfo uintptr) (r int32) { + var aFromTabs, pFactTab, pStart, pWLoop uintptr + var iFromIdx, nDep, nLoop, v5 int32 + var m, mSeen, mSelfJoin TBitmask + var mxRun TLogEst + _, _, _, _, _, _, _, _, _, _, _, _ = aFromTabs, iFromIdx, m, mSeen, mSelfJoin, mxRun, nDep, nLoop, pFactTab, pStart, pWLoop, v5 + nLoop = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) /* For looping over WhereLoops */ + if nLoop >= int32(5) && !(int32(uint32(*(*uint8)(unsafe.Pointer(pWInfo + 68))&0x10>>4)) != 0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_StarQuery)) == uint32(0) { /* Bitmask for candidate fact-table */ + mSelfJoin = uint64(0) /* Where to start searching for dimension-tables */ + libc.SetBitFieldPtr8Uint32(pWInfo+68, libc.Uint32FromInt32(1), 4, 0x10) /* Only do this computation once */ + /* Look for fact tables with four or more dimensions where the + ** dimension tables are not separately from the fact tables by an outer + ** or cross join. Adjust cost weights if found. + */ + aFromTabs = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + pStart = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpLoops + iFromIdx = 0 + m = libc.Uint64FromInt32(1) + for { + if !(iFromIdx < nLoop) { + break + } + nDep = 0 /* Maximum SCAN cost of a fact table */ + mSeen = uint64(0) /* The candidate fact table */ + pFactTab = aFromTabs + uintptr(iFromIdx)*80 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pFactTab)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)) != 0 { + /* If the candidate fact-table is the right table of an outer join + ** restrict the search for dimension-tables to be tables to the right + ** of the fact-table. */ + if iFromIdx+int32(4) > nLoop { + break + } /* Impossible to reach nDep>=4 */ + for pStart != 0 && libc.Int32FromUint8((*TWhereLoop)(unsafe.Pointer(pStart)).FiTab) <= iFromIdx { + pStart = (*TWhereLoop)(unsafe.Pointer(pStart)).FpNextLoop + } + } + pWLoop = pStart + for { + if !(pWLoop != 0) { + break + } + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(aFromTabs + uintptr((*TWhereLoop)(unsafe.Pointer(pWLoop)).FiTab)*80))).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_CROSS)) != 0 { + /* Fact-tables and dimension-tables cannot be separated by an + ** outer join (at least for the definition of fact- and dimension- + ** used by this heuristic). */ + break + } + if (*TWhereLoop)(unsafe.Pointer(pWLoop)).Fprereq&m != uint64(0) && (*TWhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf&mSeen == uint64(0) && (*TWhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf&mSelfJoin == uint64(0) { + if (*(*TSrcItem)(unsafe.Pointer(aFromTabs + uintptr((*TWhereLoop)(unsafe.Pointer(pWLoop)).FiTab)*80))).FpSTab == (*TSrcItem)(unsafe.Pointer(pFactTab)).FpSTab { + mSelfJoin |= m + } else { + nDep++ + mSeen |= (*TWhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf + } + } + goto _2 + _2: + ; + pWLoop = (*TWhereLoop)(unsafe.Pointer(pWLoop)).FpNextLoop + } + if nDep <= int32(3) { + goto _1 + } + /* If we reach this point, it means that pFactTab is a fact table + ** with four or more dimensions connected by inner joins. Proceed + ** to make cost adjustments. */ + libc.SetBitFieldPtr8Uint32(pWInfo+68, libc.Uint32FromInt32(1), 5, 0x20) + /* Compute the maximum cost of any WhereLoop for the + ** fact table plus one epsilon */ + mxRun = int16(-libc.Int32FromInt32(32768)) + pWLoop = pStart + for { + if !(pWLoop != 0) { + break + } + if libc.Int32FromUint8((*TWhereLoop)(unsafe.Pointer(pWLoop)).FiTab) < iFromIdx { + goto _3 + } + if libc.Int32FromUint8((*TWhereLoop)(unsafe.Pointer(pWLoop)).FiTab) > iFromIdx { + break + } + if int32((*TWhereLoop)(unsafe.Pointer(pWLoop)).FrRun) > int32(mxRun) { + mxRun = (*TWhereLoop)(unsafe.Pointer(pWLoop)).FrRun + } + goto _3 + _3: + ; + pWLoop = (*TWhereLoop)(unsafe.Pointer(pWLoop)).FpNextLoop + } + if int32(mxRun) < int32(LOGEST_MAX) { + mxRun++ + } + /* Increase the cost of table scans for dimension tables to be + ** slightly more than the maximum cost of the fact table */ + pWLoop = pStart + for { + if !(pWLoop != 0) { + break + } + if (*TWhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf&mSeen == uint64(0) { + goto _4 + } + if (*TWhereLoop)(unsafe.Pointer(pWLoop)).FnLTerm != 0 { + goto _4 + } + if int32((*TWhereLoop)(unsafe.Pointer(pWLoop)).FrRun) < int32(mxRun) { + (*TWhereLoop)(unsafe.Pointer(pWLoop)).FrRun = mxRun + } + goto _4 + _4: + ; + pWLoop = (*TWhereLoop)(unsafe.Pointer(pWLoop)).FpNextLoop + } + goto _1 + _1: + ; + iFromIdx++ + m <<= uint64(1) + } + } + if int32(uint32(*(*uint8)(unsafe.Pointer(pWInfo + 68))&0x20>>5)) != 0 { + v5 = int32(18) + } else { + v5 = int32(12) + } + return v5 +} + +// C documentation +// +// /* +// ** Two WhereLoop objects, pCandidate and pBaseline, are known to have the +// ** same cost. Look deep into each to see if pCandidate is even slightly +// ** better than pBaseline. Return false if it is, if pCandidate is is preferred. +// ** Return true if pBaseline is preferred or if we cannot tell the difference. +// ** +// ** Result Meaning +// ** -------- ---------------------------------------------------------- +// ** true We cannot tell the difference in pCandidate and pBaseline +// ** false pCandidate seems like a better choice than pBaseline +// */ +func _whereLoopIsNoBetter(tls *libc.TLS, pCandidate uintptr, pBaseline uintptr) (r int32) { + if (*TWhereLoop)(unsafe.Pointer(pCandidate)).FwsFlags&uint32(WHERE_INDEXED) == uint32(0) { + return int32(1) + } + if (*TWhereLoop)(unsafe.Pointer(pBaseline)).FwsFlags&uint32(WHERE_INDEXED) == uint32(0) { + return int32(1) + } + if int32((*TIndex)(unsafe.Pointer((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pCandidate + 24))).FpIndex)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pBaseline + 24))).FpIndex)).FszIdxRow) { + return 0 + } + return int32(1) +} + +// C documentation +// +// /* // ** Given the list of WhereLoop objects at pWInfo->pLoops, this routine // ** attempts to find the lowest cost path that visits each WhereLoop // ** once. This path is then loaded into the pWInfo->a[].pWLoop fields. @@ -142063,37 +144176,45 @@ func _whereSortingCost(tls *libc.TLS, pWInfo uintptr, nRow TLogEst, nOrderBy int func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - var aFrom, aSortCost, aTo, pFrom, pLevel, pParse, pSpace, pTo, pWLoop, pX, v14 uintptr - var iLoop, ii, jj, mxChoice, mxI, nFrom, nLoop, nOrder, nOrderBy, nSpace, nTo, rc, rc1, v1, v10, v2, v4, v5 int32 + var aFrom, aSortCost, aTo, pFrom, pLevel, pParse, pSpace, pTo, pWLoop, pX, v12 uintptr + var iLoop, ii, jj, mxChoice, mxI, nFrom, nLoop, nOrder, nOrderBy, nSpace, nTo, rc, rc1, v2, v3, v8 int32 var isOrdered Ti8 var maskNew TBitmask - var mxCost, mxUnsorted, nOut, rCost, rUnsorted TLogEst + var mxCost, mxUnsort, nOut, rCost, rUnsort TLogEst var wsFlags Tu32 var _ /* m at bp+16 */ TBitmask var _ /* notUsed at bp+8 */ TBitmask var _ /* revMask at bp+0 */ TBitmask var _ /* revMask at bp+24 */ TBitmask - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aFrom, aSortCost, aTo, iLoop, ii, isOrdered, jj, maskNew, mxChoice, mxCost, mxI, mxUnsorted, nFrom, nLoop, nOrder, nOrderBy, nOut, nSpace, nTo, pFrom, pLevel, pParse, pSpace, pTo, pWLoop, pX, rCost, rUnsorted, rc, rc1, wsFlags, v1, v10, v14, v2, v4, v5 /* Loop counters */ - mxI = 0 /* Number of ORDER BY clause terms */ - mxCost = 0 /* Maximum cost of a set of paths */ - mxUnsorted = 0 /* Used to divy up the pSpace memory */ - aSortCost = uintptr(0) /* Bytes of space allocated at pSpace */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aFrom, aSortCost, aTo, iLoop, ii, isOrdered, jj, maskNew, mxChoice, mxCost, mxI, mxUnsort, nFrom, nLoop, nOrder, nOrderBy, nOut, nSpace, nTo, pFrom, pLevel, pParse, pSpace, pTo, pWLoop, pX, rCost, rUnsort, rc, rc1, wsFlags, v12, v2, v3, v8 /* Loop counters */ + mxI = 0 /* Number of ORDER BY clause terms */ + mxCost = 0 /* Maximum cost of a set of paths */ + mxUnsort = 0 /* Used to divy up the pSpace memory */ + aSortCost = uintptr(0) /* Bytes of space allocated at pSpace */ pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse nLoop = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - /* TUNING: For simple queries, only the best path is tracked. - ** For 2-way joins, the 5 best paths are followed. - ** For joins of 3 or more tables, track the 10 best paths */ + /* TUNING: mxChoice is the maximum number of possible paths to preserve + ** at each step. Based on the number of loops in the FROM clause: + ** + ** nLoop mxChoice + ** ----- -------- + ** 1 1 // the most common case + ** 2 5 + ** 3+ 12 or 18 // see computeMxChoice() + */ if nLoop <= int32(1) { - v1 = int32(1) + mxChoice = int32(1) } else { if nLoop == int32(2) { - v2 = int32(5) + mxChoice = int32(5) } else { - v2 = int32(10) + if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { + mxChoice = int32(1) + } else { + mxChoice = _computeMxChoice(tls, pWInfo) + } } - v1 = v2 } - mxChoice = v1 /* If nRowEst is zero and there is an ORDER BY clause, ignore it. In this ** case the purpose of this call is to estimate the number of rows returned ** by the overall query. Once this estimate has been obtained, the caller @@ -142122,8 +144243,8 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) break } (*TWherePath)(unsafe.Pointer(pFrom)).FaLoop = pX - goto _3 - _3: + goto _1 + _1: ; ii-- pFrom += 32 @@ -142145,11 +144266,11 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ** of computing an automatic index is not paid back within the first 28 ** rows, then do not use the automatic index. */ if int32((*TParse)(unsafe.Pointer(pParse)).FnQueryLoop) < int32(48) { - v4 = int32((*TParse)(unsafe.Pointer(pParse)).FnQueryLoop) + v2 = int32((*TParse)(unsafe.Pointer(pParse)).FnQueryLoop) } else { - v4 = int32(48) + v2 = int32(48) } - (*(*TWherePath)(unsafe.Pointer(aFrom))).FnRow = int16(v4) + (*(*TWherePath)(unsafe.Pointer(aFrom))).FnRow = int16(v2) nFrom = int32(1) if nOrderBy != 0 { /* If nLoop is zero, then there are no FROM terms in the query. Since @@ -142159,11 +144280,11 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ** -1, indicating that the result set may or may not be ordered, ** depending on the loops added to the current plan. */ if nLoop > 0 { - v5 = -int32(1) + v3 = -int32(1) } else { - v5 = nOrderBy + v3 = nOrderBy } - (*(*TWherePath)(unsafe.Pointer(aFrom))).FisOrdered = int8(v5) + (*(*TWherePath)(unsafe.Pointer(aFrom))).FisOrdered = int8(v3) } /* Compute successively longer WherePaths using the previous generation ** of WherePaths as the basis for the next. Keep track of the mxChoice @@ -142186,22 +144307,25 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) break } /* Mask of rev-order loops for (..) */ if (*TWhereLoop)(unsafe.Pointer(pWLoop)).Fprereq & ^(*TWherePath)(unsafe.Pointer(pFrom)).FmaskLoop != uint64(0) { - goto _8 + goto _6 } if (*TWhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf&(*TWherePath)(unsafe.Pointer(pFrom)).FmaskLoop != uint64(0) { - goto _8 + goto _6 } if (*TWhereLoop)(unsafe.Pointer(pWLoop)).FwsFlags&uint32(WHERE_AUTO_INDEX) != uint32(0) && int32((*TWherePath)(unsafe.Pointer(pFrom)).FnRow) < int32(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 ** index is useful in the outer loop of a correlated subquery. */ - goto _8 + goto _6 } /* At this point, pWLoop is a candidate to be the next loop. ** Compute its cost */ - rUnsorted = _sqlite3LogEstAdd(tls, (*TWhereLoop)(unsafe.Pointer(pWLoop)).FrSetup, int16(int32((*TWhereLoop)(unsafe.Pointer(pWLoop)).FrRun)+int32((*TWherePath)(unsafe.Pointer(pFrom)).FnRow))) - rUnsorted = _sqlite3LogEstAdd(tls, rUnsorted, (*TWherePath)(unsafe.Pointer(pFrom)).FrUnsorted) + rUnsort = int16(int32((*TWhereLoop)(unsafe.Pointer(pWLoop)).FrRun) + int32((*TWherePath)(unsafe.Pointer(pFrom)).FnRow)) + if (*TWhereLoop)(unsafe.Pointer(pWLoop)).FrSetup != 0 { + rUnsort = _sqlite3LogEstAdd(tls, (*TWhereLoop)(unsafe.Pointer(pWLoop)).FrSetup, rUnsort) + } + rUnsort = _sqlite3LogEstAdd(tls, rUnsort, (*TWherePath)(unsafe.Pointer(pFrom)).FrUnsort) nOut = int16(int32((*TWherePath)(unsafe.Pointer(pFrom)).FnRow) + int32((*TWhereLoop)(unsafe.Pointer(pWLoop)).FnOut)) maskNew = (*TWherePath)(unsafe.Pointer(pFrom)).FmaskLoop | (*TWhereLoop)(unsafe.Pointer(pWLoop)).FmaskSelf isOrdered = (*TWherePath)(unsafe.Pointer(pFrom)).FisOrdered @@ -142219,10 +144343,10 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ** extra encouragement to the query planner to select a plan ** where the rows emerge in the correct order without any sorting ** required. */ - rCost = int16(int32(_sqlite3LogEstAdd(tls, rUnsorted, *(*TLogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2)))) + int32(3)) + rCost = int16(int32(_sqlite3LogEstAdd(tls, rUnsort, *(*TLogEst)(unsafe.Pointer(aSortCost + uintptr(isOrdered)*2)))) + int32(3)) } else { - rCost = rUnsorted - rUnsorted = TLogEst(int32(rUnsorted) - libc.Int32FromInt32(2)) /* TUNING: Slight bias in favor of no-sort plans */ + rCost = rUnsort + rUnsort = TLogEst(int32(rUnsort) - libc.Int32FromInt32(2)) /* TUNING: Slight bias in favor of no-sort plans */ } /* Check to see if pWLoop should be added to the set of ** mxChoice best-so-far paths. @@ -142244,27 +144368,27 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) if (*TWherePath)(unsafe.Pointer(pTo)).FmaskLoop == maskNew && (int32((*TWherePath)(unsafe.Pointer(pTo)).FisOrdered)^int32(isOrdered))&int32(0x80) == 0 { break } - goto _9 - _9: + goto _7 + _7: ; jj++ pTo += 32 } if jj >= nTo { /* None of the existing best-so-far paths match the candidate. */ - if nTo >= mxChoice && (int32(rCost) > int32(mxCost) || int32(rCost) == int32(mxCost) && int32(rUnsorted) >= int32(mxUnsorted)) { + if nTo >= mxChoice && (int32(rCost) > int32(mxCost) || int32(rCost) == int32(mxCost) && int32(rUnsort) >= int32(mxUnsort)) { /* The current candidate is no better than any of the mxChoice ** paths currently in the best-so-far buffer. So discard ** this candidate as not viable. */ - goto _8 + goto _6 } /* If we reach this points it means that the new candidate path ** needs to be added to the set of best-so-far paths. */ if nTo < mxChoice { /* Increase the size of the aTo set by one */ - v10 = nTo + v8 = nTo nTo++ - jj = v10 + jj = v8 } else { /* New path replaces the prior worst to keep count below mxChoice */ jj = mxI @@ -142277,11 +144401,11 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) ** pTo or if the candidate should be skipped. ** ** The conditional is an expanded vector comparison equivalent to: - ** (pTo->rCost,pTo->nRow,pTo->rUnsorted) <= (rCost,nOut,rUnsorted) + ** (pTo->rCost,pTo->nRow,pTo->rUnsort) <= (rCost,nOut,rUnsort) */ - if int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) < int32(rCost) || int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) == int32(rCost) && (int32((*TWherePath)(unsafe.Pointer(pTo)).FnRow) < int32(nOut) || int32((*TWherePath)(unsafe.Pointer(pTo)).FnRow) == int32(nOut) && int32((*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted) <= int32(rUnsorted)) { + if int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) < int32(rCost) || int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) == int32(rCost) && int32((*TWherePath)(unsafe.Pointer(pTo)).FnRow) < int32(nOut) || int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) == int32(rCost) && int32((*TWherePath)(unsafe.Pointer(pTo)).FnRow) == int32(nOut) && int32((*TWherePath)(unsafe.Pointer(pTo)).FrUnsort) < int32(rUnsort) || int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) == int32(rCost) && int32((*TWherePath)(unsafe.Pointer(pTo)).FnRow) == int32(nOut) && int32((*TWherePath)(unsafe.Pointer(pTo)).FrUnsort) == int32(rUnsort) && _whereLoopIsNoBetter(tls, pWLoop, *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pTo)).FaLoop + uintptr(iLoop)*8))) != 0 { /* Discard the candidate path from further consideration */ - goto _8 + goto _6 } /* Control reaches here if the candidate path is better than the ** pTo path. Replace pTo with the candidate. */ @@ -142291,39 +144415,39 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) (*TWherePath)(unsafe.Pointer(pTo)).FrevLoop = *(*TBitmask)(unsafe.Pointer(bp)) (*TWherePath)(unsafe.Pointer(pTo)).FnRow = nOut (*TWherePath)(unsafe.Pointer(pTo)).FrCost = rCost - (*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted = rUnsorted + (*TWherePath)(unsafe.Pointer(pTo)).FrUnsort = rUnsort (*TWherePath)(unsafe.Pointer(pTo)).FisOrdered = isOrdered libc.Xmemcpy(tls, (*TWherePath)(unsafe.Pointer(pTo)).FaLoop, (*TWherePath)(unsafe.Pointer(pFrom)).FaLoop, uint64(8)*libc.Uint64FromInt32(iLoop)) *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pTo)).FaLoop + uintptr(iLoop)*8)) = pWLoop if nTo >= mxChoice { mxI = 0 mxCost = (*(*TWherePath)(unsafe.Pointer(aTo))).FrCost - mxUnsorted = (*(*TWherePath)(unsafe.Pointer(aTo))).FnRow + mxUnsort = (*(*TWherePath)(unsafe.Pointer(aTo))).FnRow jj = int32(1) pTo = aTo + 1*32 for { if !(jj < mxChoice) { break } - if int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) > int32(mxCost) || int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) == int32(mxCost) && int32((*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted) > int32(mxUnsorted) { + if int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) > int32(mxCost) || int32((*TWherePath)(unsafe.Pointer(pTo)).FrCost) == int32(mxCost) && int32((*TWherePath)(unsafe.Pointer(pTo)).FrUnsort) > int32(mxUnsort) { mxCost = (*TWherePath)(unsafe.Pointer(pTo)).FrCost - mxUnsorted = (*TWherePath)(unsafe.Pointer(pTo)).FrUnsorted + mxUnsort = (*TWherePath)(unsafe.Pointer(pTo)).FrUnsort mxI = jj } - goto _11 - _11: + goto _9 + _9: ; jj++ pTo += 32 } } - goto _8 - _8: + goto _6 + _6: ; pWLoop = (*TWhereLoop)(unsafe.Pointer(pWLoop)).FpNextLoop } - goto _7 - _7: + goto _5 + _5: ; ii++ pFrom += 32 @@ -142333,13 +144457,13 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) aTo = aFrom aFrom = pFrom nFrom = nTo - goto _6 - _6: + goto _4 + _4: ; iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22637, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22718, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -142353,8 +144477,8 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) if int32((*TWherePath)(unsafe.Pointer(pFrom)).FrCost) > int32((*(*TWherePath)(unsafe.Pointer(aFrom + uintptr(ii)*32))).FrCost) { pFrom = aFrom + uintptr(ii)*32 } - goto _12 - _12: + goto _10 + _10: ; ii++ } @@ -142365,13 +144489,13 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) break } pLevel = pWInfo + 856 + uintptr(iLoop)*104 - v14 = *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(iLoop)*8)) - pWLoop = v14 - (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop = v14 + v12 = *(*uintptr)(unsafe.Pointer((*TWherePath)(unsafe.Pointer(pFrom)).FaLoop + uintptr(iLoop)*8)) + pWLoop = v12 + (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop = v12 (*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom = (*TWhereLoop)(unsafe.Pointer(pWLoop)).FiTab - (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104))).FiCursor - goto _13 - _13: + (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80))).FiCursor + goto _11 + _11: ; iLoop++ } @@ -142541,11 +144665,11 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { return 0 } pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 - pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab + pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { return 0 } - if int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x2>>1)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x1>>0)) != 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x2>>1) != 0 || int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x1>>0) != 0 { return 0 } iCur = (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor @@ -142561,7 +144685,14 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags = libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ) | libc.Int32FromInt32(WHERE_IPK) | libc.Int32FromInt32(WHERE_ONEROW)) *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) = pTerm (*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = uint16(1) - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq = uint16(1) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq = uint16(1) /* TUNING: Cost of a rowid lookup is 10 */ (*TWhereLoop)(unsafe.Pointer(pLoop)).FrRun = int16(33) /* 33==sqlite3LogEst(10) */ } else { @@ -142605,8 +144736,22 @@ func _whereShortCut(tls *libc.TLS, pBuilder uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IDX_ONLY) } (*TWhereLoop)(unsafe.Pointer(pLoop)).FnLTerm = libc.Uint16FromInt32(j) - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnEq = libc.Uint16FromInt32(j) - (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex = pIdx + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnEq = libc.Uint16FromInt32(j) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex = pIdx /* TUNING: Cost of a unique index lookup is 15 */ (*TWhereLoop)(unsafe.Pointer(pLoop)).FrRun = int16(39) /* 39==sqlite3LogEst(15) */ break @@ -142712,9 +144857,9 @@ func _exprIsDeterministic(tls *libc.TLS, p uintptr) (r int32) { // */ func _whereOmitNoopJoin(tls *libc.TLS, pWInfo uintptr, notReady TBitmask) (r TBitmask) { var hasRightJoin, i, nByte int32 + var m1, tabUsed TBitmask var pEnd, pItem, pLoop, pTerm, p4 uintptr - var tabUsed TBitmask - _, _, _, _, _, _, _, _, _ = hasRightJoin, i, nByte, pEnd, pItem, pLoop, pTerm, tabUsed, p4 + _, _, _, _, _, _, _, _, _, _ = hasRightJoin, i, m1, nByte, pEnd, pItem, pLoop, pTerm, tabUsed, p4 /* Preconditions checked by the caller */ /* These two preconditions checked by the caller combine to guarantee ** condition (1) of the header comment */ @@ -142729,7 +144874,7 @@ func _whereOmitNoopJoin(tls *libc.TLS, pWInfo uintptr, notReady TBitmask) (r TBi break } pLoop = (*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(i)*104))).FpWLoop - pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*104 + pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80 if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) != int32(JT_LEFT) { goto _1 } @@ -142761,6 +144906,8 @@ func _whereOmitNoopJoin(tls *libc.TLS, pWInfo uintptr, notReady TBitmask) (r TBi if pTerm < pEnd { goto _1 } + m1 = libc.Uint64FromInt32(1)<<i - uint64(1) + (*TWhereInfo)(unsafe.Pointer(pWInfo)).FrevMask = m1&(*TWhereInfo)(unsafe.Pointer(pWInfo)).FrevMask | (*TWhereInfo)(unsafe.Pointer(pWInfo)).FrevMask>>libc.Int32FromInt32(1) & ^m1 notReady &= ^(*TWhereLoop)(unsafe.Pointer(pLoop)).FmaskSelf pTerm = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FsWC.Fa for { @@ -142823,8 +144970,8 @@ func _whereCheckIfBloomFilterIsUseful(tls *libc.TLS, pWInfo uintptr) { } pLoop = (*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(i)*104))).FpWLoop reqFlags = libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_SELFCULL) | libc.Int32FromInt32(WHERE_COLUMN_EQ)) - pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*104 - pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpTab + pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80 + pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasStat1) == uint32(0) { break } @@ -142846,68 +144993,6 @@ func _whereCheckIfBloomFilterIsUseful(tls *libc.TLS, pWInfo uintptr) { // C documentation // // /* -// ** Expression Node callback for sqlite3ExprCanReturnSubtype(). -// ** -// ** Only a function call is able to return a subtype. So if the node -// ** is not a function call, return WRC_Prune immediately. -// ** -// ** A function call is able to return a subtype if it has the -// ** SQLITE_RESULT_SUBTYPE property. -// ** -// ** Assume that every function is able to pass-through a subtype from -// ** one of its argument (using sqlite3_result_value()). Most functions -// ** are not this way, but we don't have a mechanism to distinguish those -// ** that are from those that are not, so assume they all work this way. -// ** That means that if one of its arguments is another function and that -// ** other function is able to return a subtype, then this function is -// ** able to return a subtype. -// */ -func _exprNodeCanReturnSubtype(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - var db, pDef uintptr - var n, v1 int32 - _, _, _, _ = db, n, pDef, v1 - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_FUNCTION) { - return int32(WRC_Prune) - } - db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v1 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v1 = 0 - } - n = v1 - pDef = _sqlite3FindFunction(tls, db, *(*uintptr)(unsafe.Pointer(pExpr + 8)), n, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, uint8(0)) - if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_RESULT_SUBTYPE) != uint32(0) { - (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) - return int32(WRC_Prune) - } - return WRC_Continue -} - -// C documentation -// -// /* -// ** Return TRUE if expression pExpr is able to return a subtype. -// ** -// ** A TRUE return does not guarantee that a subtype will be returned. -// ** It only indicates that a subtype return is possible. False positives -// ** are acceptable as they only disable an optimization. False negatives, -// ** on the other hand, can lead to incorrect answers. -// */ -func _sqlite3ExprCanReturnSubtype(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) - var _ /* w at bp+0 */ TWalker - libc.Xmemset(tls, bp, 0, uint64(48)) - (*(*TWalker)(unsafe.Pointer(bp))).FpParse = pParse - (*(*TWalker)(unsafe.Pointer(bp))).FxExprCallback = __ccgo_fp(_exprNodeCanReturnSubtype) - _sqlite3WalkExpr(tls, bp, pExpr) - return libc.Int32FromUint16((*(*TWalker)(unsafe.Pointer(bp))).FeCode) -} - -// C documentation -// -// /* // ** The index pIdx is used by a query and contains one or more expressions. // ** In other words pIdx is an index on an expression. iIdxCur is the cursor // ** number for the index and iDataCur is the cursor number for the corresponding @@ -142941,12 +145026,6 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i if _sqlite3ExprIsConstant(tls, uintptr(0), pExpr) != 0 { goto _1 } - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_FUNCTION) && _sqlite3ExprCanReturnSubtype(tls, pParse, pExpr) != 0 { - /* Functions that might set a subtype should not be replaced by the - ** value taken from an expression index since the index omits the - ** subtype. https://sqlite.org/forum/forumpost/68d284c86b082c3e */ - goto _1 - } p = _sqlite3DbMallocRaw(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(32)) if p == uintptr(0) { break @@ -142991,8 +145070,8 @@ func _whereReverseScanOrder(tls *libc.TLS, pWInfo uintptr) { if !(ii < (*TSrcList)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList)).FnSrc) { break } - pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr(ii)*104 - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pItem + 60 + 4))&0x100>>8)) != 0) || libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 96)))).FeM10d) != M10d_Yes || (*TSrcItem)(unsafe.Pointer(pItem)).FpSelect == uintptr(0) || (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSelect)).FpOrderBy == uintptr(0) { + pItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr(ii)*80 + if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x200>>9) != 0) || libc.Int32FromUint8((*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 56)))).FeM10d) != M10d_Yes || int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 || (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect)).FpOrderBy == uintptr(0) { *(*TBitmask)(unsafe.Pointer(pWInfo + 96)) |= libc.Uint64FromInt32(1) << ii } goto _1 @@ -143095,15 +145174,15 @@ func _whereReverseScanOrder(tls *libc.TLS, pWInfo uintptr) { func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pResultSet uintptr, pSelect uintptr, wctrlFlags Tu16, iAuxArg int32) (r uintptr) { bp := tls.Alloc(80) defer tls.Free(80) - var addrExplain, bOnerow, iCur, iDb, iIndexCur, iOnce, ii, n, nByteWInfo, nTabList, op, op1, rc, wsFlags, wsFlags1, v1, v12, v15, v19, v2, v21, v23, v3, v4 int32 + var addrExplain, bOnerow, iCur, iDb, iIndexCur, iOnce, ii, n, nByteWInfo, nTabList, op, op1, rc, wsFlags, wsFlags1, v1, v10, v13, v16, v2, v20, v22, v24, v3, v4 int32 var b, notReady TBitmask var bFordelete Tu8 - var db, p, pInfo, pIx, pJ, pLevel, pLoop, pMaskSet, pPk, pRJ, pSrc, pT, pTab, pTabItem, pVTab, pWInfo, pX, v, v16, v17, v20, v22, v24, p10, p11, p7, p8, p9 uintptr - var v18 bool + var db, p, pInfo, pIx, pJ, pLevel, pLoop, pMaskSet, pPk, pRJ, pSrc, pSubq, pT, pTab, pTabItem, pVTab, pWInfo, pX, v, v17, v18, v21, v23, v25, p11, p12, p7, p8, p9 uintptr + var v19 bool var _ /* sWLB at bp+0 */ TWhereLoopBuilder - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrExplain, b, bFordelete, bOnerow, db, iCur, iDb, iIndexCur, iOnce, ii, n, nByteWInfo, nTabList, notReady, op, op1, p, pInfo, pIx, pJ, pLevel, pLoop, pMaskSet, pPk, pRJ, pSrc, pT, pTab, pTabItem, pVTab, pWInfo, pX, rc, v, wsFlags, wsFlags1, v1, v12, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, p10, p11, p7, p8, p9 /* Will become the return value of this function */ - v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Return code */ - bFordelete = uint8(0) /* OPFLAG_FORDELETE or zero, as appropriate */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrExplain, b, bFordelete, bOnerow, db, iCur, iDb, iIndexCur, iOnce, ii, n, nByteWInfo, nTabList, notReady, op, op1, p, pInfo, pIx, pJ, pLevel, pLoop, pMaskSet, pPk, pRJ, pSrc, pSubq, pT, pTab, pTabItem, pVTab, pWInfo, pX, rc, v, wsFlags, wsFlags1, v1, v10, v13, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v3, v4, p11, p12, p7, p8, p9 /* Will become the return value of this function */ + v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Return code */ + bFordelete = uint8(0) /* OPFLAG_FORDELETE or zero, as appropriate */ /* Only one of WHERE_OR_SUBCLAUSE or WHERE_USE_LIMIT */ /* Variable initialization */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb @@ -143118,7 +145197,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22655, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22736, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -143191,7 +145270,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22683, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22764, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -143210,8 +145289,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere */ ii = 0 for { - _createMask(tls, pMaskSet, (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(ii)*104))).FiCursor) - _sqlite3WhereTabFuncArgs(tls, pParse, pTabList+8+uintptr(ii)*104, pWInfo+104) + _createMask(tls, pMaskSet, (*(*TSrcItem)(unsafe.Pointer(pTabList + 8 + uintptr(ii)*80))).FiCursor) + _sqlite3WhereTabFuncArgs(tls, pParse, pTabList+8+uintptr(ii)*80, pWInfo+104) goto _5 _5: ; @@ -143325,7 +145404,12 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy != 0 { _whereInterstageHeuristic(tls, pWInfo) - _wherePathSolver(tls, pWInfo, int16(int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)+int32(1))) + if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut) < 0 { + v10 = int32(1) + } else { + v10 = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut) + int32(1) + } + _wherePathSolver(tls, pWInfo, int16(v10)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto whereBeginError } @@ -143334,8 +145418,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** the output size by a factor of 8 (LogEst -30). */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { - p10 = pWInfo + 70 - *(*TLogEst)(unsafe.Pointer(p10)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p10))) - libc.Int32FromInt32(30)) + p11 = pWInfo + 70 + *(*TLogEst)(unsafe.Pointer(p11)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p11))) - libc.Int32FromInt32(30)) } } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpOrderBy == uintptr(0) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ReverseOrder) != uint64(0) { @@ -143365,8 +145449,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p11 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 - *(*TLogEst)(unsafe.Pointer(p11)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p11))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(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. ** @@ -143389,14 +145473,14 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) - if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { + if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { - v12 = int32(ONEPASS_SINGLE) + v13 = int32(ONEPASS_SINGLE) } else { - v12 = int32(ONEPASS_MULTI) + v13 = int32(ONEPASS_MULTI) } - (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = libc.Uint8FromInt32(v12) - if (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && wsFlags&int32(WHERE_IDX_ONLY) != 0 { + (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass = libc.Uint8FromInt32(v13) + if (*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && wsFlags&int32(WHERE_IDX_ONLY) != 0 { if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } @@ -143413,8 +145497,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if !(ii < nTabList) { break } - pTabItem = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104 - pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpTab + pTabItem = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 + pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Ephemeral) != uint32(0) || libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { @@ -143445,8 +145529,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if !(b != 0) { break } - goto _14 - _14: + goto _15 + _15: ; b = b >> int32(1) n++ @@ -143461,7 +145545,14 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_INDEXED) != 0 { - pIx = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex + pIx = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex op1 = int32(OP_OpenRead) /* iAuxArg is always set to a positive value if ONEPASS is possible */ if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) != 0 { @@ -143471,7 +145562,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere op1 = 0 } else { if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeOnePass) != ONEPASS_OFF { - pJ = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpTab)).FpIndex + pJ = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FpIndex iIndexCur = iAuxArg for pJ != 0 && pJ != pIx { iIndexCur++ @@ -143484,10 +145575,10 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v16 = pParse + 52 - v15 = *(*int32)(unsafe.Pointer(v16)) - *(*int32)(unsafe.Pointer(v16))++ - iIndexCur = v15 + v17 = pParse + 56 + v16 = *(*int32)(unsafe.Pointer(v17)) + *(*int32)(unsafe.Pointer(v17))++ + iIndexCur = v16 if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } @@ -143509,25 +145600,25 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if iDb >= 0 { _sqlite3CodeVerifySchema(tls, pParse, iDb) } - if v18 = libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0; v18 { - v17 = _sqlite3WhereMalloc(tls, pWInfo, uint64(20)) - (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ = v17 + if v19 = libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0; v19 { + v18 = _sqlite3WhereMalloc(tls, pWInfo, uint64(20)) + (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ = v18 } - if v18 && v17 != uintptr(0) { + if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v20 = pParse + 52 - v19 = *(*int32)(unsafe.Pointer(v20)) - *(*int32)(unsafe.Pointer(v20))++ - (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v19 - v22 = pParse + 56 - *(*int32)(unsafe.Pointer(v22))++ - v21 = *(*int32)(unsafe.Pointer(v22)) - (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v21 + v21 = pParse + 56 + v20 = *(*int32)(unsafe.Pointer(v21)) + *(*int32)(unsafe.Pointer(v21))++ + (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 + v23 = pParse + 60 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v24 = pParse + 56 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v23 + v25 = pParse + 60 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch, int32(1)) @@ -143549,8 +145640,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FnOBSat = 0 (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNORDERED) } - goto _13 - _13: + goto _14 + _14: ; ii++ pLevel += 104 @@ -143573,13 +145664,17 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } pLevel = pWInfo + 856 + uintptr(ii)*104 wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) - pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104 - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x10>>4)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x8>>3)) != 0 { - _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSrcItem)(unsafe.Pointer(pSrc)).FregReturn, (*TSrcItem)(unsafe.Pointer(pSrc)).FaddrFillSub) - } else { + pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 + if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { + iOnce = 0 + pSubq = *(*uintptr)(unsafe.Pointer(pSrc + 72)) + if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x10>>4) == 0 { iOnce = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSrcItem)(unsafe.Pointer(pSrc)).FregReturn, (*TSrcItem)(unsafe.Pointer(pSrc)).FaddrFillSub) + } else { + iOnce = 0 + } + _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub) + if iOnce != 0 { _sqlite3VdbeJumpHere(tls, v, iOnce) } } @@ -143600,8 +145695,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if wsFlags1&int32(WHERE_MULTI_OR) == 0 && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { _ = addrExplain } - goto _25 - _25: + goto _26 + _26: ; ii++ } @@ -143665,11 +145760,25 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) != int32(OP_Noop) { addrSeek = 0 if v3 = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct) == int32(WHERE_DISTINCT_ORDERED) && i == libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel)-int32(1) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_INDEXED) != uint32(0); v3 { - v2 = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex + v2 = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex pIdx = v2 } if v5 = v3 && int32(uint32(*(*uint16)(unsafe.Pointer(v2 + 100))&0x80>>7)) != 0; v5 { - v4 = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FnDistinctCol) + v4 = libc.Int32FromUint16((*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FnDistinctCol) n = v4 } if v5 && v4 > 0 && int32(*(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiRowLogEst + uintptr(n)*2))) >= int32(36) { @@ -143685,7 +145794,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 56)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -143777,10 +145886,10 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ws = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfPos), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin) if ws&int32(WHERE_IDX_ONLY) == 0 { - pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104 - if int32(uint32(*(*uint16)(unsafe.Pointer(pSrc + 60 + 4))&0x20>>5)) != 0 { - n1 = (*TSrcItem)(unsafe.Pointer(pSrc)).FregResult - m = int32((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpTab)).FnCol) + pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 + if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x40>>6) != 0 { + n1 = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pSrc + 72)))).FregResult + m = int32((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FnCol) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, n1, n1+m-int32(1)) } _sqlite3VdbeAddOp1(tls, v, int32(OP_NullRow), (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur) @@ -143813,8 +145922,8 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { break } pIdx1 = uintptr(0) - pTabItem = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*104 - pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpTab + pTabItem = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 + pTab = (*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop /* Do RIGHT JOIN processing. Generate code that will output the ** unmatched rows of the right operand of the RIGHT JOIN with @@ -143828,8 +145937,8 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ** the co-routine into OP_Copy of result contained in a register. ** OP_Rowid becomes OP_Null. */ - if int32(uint32(*(*uint16)(unsafe.Pointer(pTabItem + 60 + 4))&0x20>>5)) != 0 { - _translateColumnToCopy(tls, pParse, (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBody, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (*TSrcItem)(unsafe.Pointer(pTabItem)).FregResult, 0) + if int32(*(*uint32)(unsafe.Pointer(pTabItem + 24 + 4))&0x40>>6) != 0 { + _translateColumnToCopy(tls, pParse, (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBody, (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur, (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pTabItem + 72)))).FregResult, 0) goto _9 } /* If this scan uses an index, make VDBE code substitutions to read data @@ -143844,7 +145953,14 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ** reference the index. */ if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_INDEXED)|libc.Int32FromInt32(WHERE_IDX_ONLY)) != 0 { - pIdx1 = (*TWhereLoop)(unsafe.Pointer(pLoop)).Fu.Fbtree.FpIndex + pIdx1 = (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pLoop + 24))).FpIndex } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { pIdx1 = *(*uintptr)(unsafe.Pointer(&(*TWhereLevel)(unsafe.Pointer(pLevel)).Fu)) @@ -143890,13 +146006,24 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur } else { - /* Unable to translate the table reference into an index - ** reference. Verify that this is harmless - that the - ** table being referenced really is open. - */ - if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IDX_ONLY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22701, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { + if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IDX_ONLY) != 0 { + /* An error. pLoop is supposed to be a covering index loop, + ** and yet the VM code refers to a column of the table that + ** is not part of the index. */ + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22782, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) + } else { + /* The WHERE_EXPRIDX flag is set by the planner when it is likely + ** that pLoop is a covering index loop, but it is not possible + ** to be 100% sure. In this case, any OP_Explain opcode + ** corresponding to this loop describes the index as a "COVERING + ** INDEX". But, pOp proves that pLoop is not actually a covering + ** index loop. So clear the WHERE_EXPRIDX flag and rewrite the + ** text that accompanies the OP_Explain opcode, if any. */ + *(*Tu32)(unsafe.Pointer(pLoop + 48)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(WHERE_EXPRIDX)) + _sqlite3WhereAddExplainText(tls, pParse, (*TWhereLevel)(unsafe.Pointer(pLevel)).FaddrBody-int32(1), pTabList, pLevel, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags) + } } } } else { @@ -144203,7 +146330,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22730, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22811, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -144385,7 +146512,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22786, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22867, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -144577,52 +146704,52 @@ var _aWindowFuncs = [15]TFuncDef{ FzName: uintptr(unsafe.Pointer(&_cume_distName)), }, 5: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_ntileName)), }, 6: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_last_valueName)), }, 7: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_nth_valueName)), }, 8: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_first_valueName)), }, 9: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_leadName)), }, 10: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_leadName)), }, 11: { - FnArg: int8(3), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_leadName)), }, 12: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_lagName)), }, 13: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_lagName)), }, 14: { - FnArg: int8(3), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_WINDOW) | libc.Int32FromInt32(0)), FzName: uintptr(unsafe.Pointer(&_lagName)), }, @@ -144711,7 +146838,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22831, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22912, libc.VaList(bp+8, zName)) } return p } @@ -144762,12 +146889,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22850, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22931, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22921, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23002, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -144840,7 +146967,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8255) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8317) } break } @@ -144909,7 +147036,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*104))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -145082,7 +147209,7 @@ func _exprListAppendList(tls *libc.TLS, pParse uintptr, pList uintptr, pAppend u } if bIntToNull != 0 { pSub = _sqlite3ExprSkipCollateAndLikely(tls, pDup) - if _sqlite3ExprIsInteger(tls, pSub, bp) != 0 { + if _sqlite3ExprIsInteger(tls, pSub, bp, uintptr(0)) != 0 { (*TExpr)(unsafe.Pointer(pSub)).Fop = uint8(TK_NULL) *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_IntValue) | libc.Int32FromInt32(EP_IsTrue) | libc.Int32FromInt32(EP_IsFalse))) *(*uintptr)(unsafe.Pointer(pSub + 8)) = uintptr(0) @@ -145122,7 +147249,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+22984, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23065, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -145192,11 +147319,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 52 + v2 = pParse + 56 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 52)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -145242,11 +147369,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 56 + v8 = pParse + 60 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 56 + v10 = pParse + 60 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -145263,38 +147390,39 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1782)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) /* Due to db->mallocFailed test inside ** of sqlite3DbMallocRawNN() called from ** sqlite3SrcListAppend() */ - if (*TSelect)(unsafe.Pointer(p)).FpSrc != 0 { - (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSelect = pSub - libc.SetBitFieldPtr16Uint32((*TSelect)(unsafe.Pointer(p)).FpSrc+8+60+4, libc.Uint32FromInt32(1), 3, 0x8) - _sqlite3SrcListAssignCursors(tls, pParse, (*TSelect)(unsafe.Pointer(p)).FpSrc) - *(*Tu32)(unsafe.Pointer(pSub + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SF_Expanded) | libc.Int32FromInt32(SF_OrderByReqd)) - pTab2 = _sqlite3ResultSetOfSelect(tls, pParse, pSub, uint8(SQLITE_AFF_NONE)) - *(*Tu32)(unsafe.Pointer(pSub + 4)) |= selFlags & uint32(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 - ** the correct error message regardless. */ - rc = int32(SQLITE_NOMEM) - } else { - libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) - *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) - (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpTab = pTab - pTab = pTab2 - libc.Xmemset(tls, bp+8, 0, uint64(48)) - (*(*TWalker)(unsafe.Pointer(bp + 8))).FxExprCallback = __ccgo_fp(_sqlite3WindowExtraAggFuncDepth) - (*(*TWalker)(unsafe.Pointer(bp + 8))).FxSelectCallback = __ccgo_fp(_sqlite3WalkerDepthIncrease) - (*(*TWalker)(unsafe.Pointer(bp + 8))).FxSelectCallback2 = __ccgo_fp(_sqlite3WalkerDepthDecrease) - _sqlite3WalkSelect(tls, bp+8, pSub) - } - } else { + if (*TSelect)(unsafe.Pointer(p)).FpSrc == uintptr(0) { _sqlite3SelectDelete(tls, db, pSub) + } else { + if _sqlite3SrcItemAttachSubquery(tls, pParse, (*TSelect)(unsafe.Pointer(p)).FpSrc+8, pSub, 0) != 0 { + libc.SetBitFieldPtr32Uint32((*TSelect)(unsafe.Pointer(p)).FpSrc+8+24+4, libc.Uint32FromInt32(1), 4, 0x10) + _sqlite3SrcListAssignCursors(tls, pParse, (*TSelect)(unsafe.Pointer(p)).FpSrc) + *(*Tu32)(unsafe.Pointer(pSub + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SF_Expanded) | libc.Int32FromInt32(SF_OrderByReqd)) + pTab2 = _sqlite3ResultSetOfSelect(tls, pParse, pSub, uint8(SQLITE_AFF_NONE)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) |= selFlags & uint32(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 + ** the correct error message regardless. */ + rc = int32(SQLITE_NOMEM) + } else { + libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) + *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) + (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab + pTab = pTab2 + libc.Xmemset(tls, bp+8, 0, uint64(48)) + (*(*TWalker)(unsafe.Pointer(bp + 8))).FxExprCallback = __ccgo_fp(_sqlite3WindowExtraAggFuncDepth) + (*(*TWalker)(unsafe.Pointer(bp + 8))).FxSelectCallback = __ccgo_fp(_sqlite3WalkerDepthIncrease) + (*(*TWalker)(unsafe.Pointer(bp + 8))).FxSelectCallback2 = __ccgo_fp(_sqlite3WalkerDepthDecrease) + _sqlite3WalkSelect(tls, bp+8, pSub) + } + } } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) @@ -145408,7 +147536,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23010, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23091, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -145476,18 +147604,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23042 + zErr = __ccgo_ts + 23123 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23059 + zErr = __ccgo_ts + 23140 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23075 + zErr = __ccgo_ts + 23156 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23095, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23176, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -145511,7 +147639,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23128, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23209, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -145605,7 +147733,7 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { var nEphExpr, nExpr, v1, v10, v12, v14, v3, v5, v7 int32 var p, pKeyInfo, pList, pMWin, pWin, v, v11, v13, v15, v2, v4, v6, v8 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = nEphExpr, nExpr, p, pKeyInfo, pList, pMWin, pWin, v, v1, v10, v11, v12, v13, v14, v15, v2, v3, v4, v5, v6, v7, v8 - nEphExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpSrc + 8))).FpSelect)).FpEList)).FnExpr + nEphExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpSrc + 8 + 72)))).FpSelect)).FpEList)).FnExpr pMWin = (*TSelect)(unsafe.Pointer(pSelect)).FpWin v = _sqlite3GetVdbe(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr, nEphExpr) @@ -145617,24 +147745,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 56 + v4 = pParse + 60 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 56 + v6 = pParse + 60 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 52 + v8 = pParse + 56 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -145652,12 +147780,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 52 + v11 = pParse + 56 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pKeyInfo != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -145669,15 +147797,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 52 + v13 = pParse + 56 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 52 + v15 = pParse + 56 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -145710,7 +147838,7 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regZero) if eCond >= int32(WINDOW_STARTING_NUM) { regString = _sqlite3GetTempReg(tls, pParse) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1662, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1663, -int32(1)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } else { @@ -145729,11 +147857,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23175, - 1: __ccgo_ts + 23228, - 2: __ccgo_ts + 22730, - 3: __ccgo_ts + 23279, - 4: __ccgo_ts + 23331, + 0: __ccgo_ts + 23256, + 1: __ccgo_ts + 23309, + 2: __ccgo_ts + 22811, + 3: __ccgo_ts + 23360, + 4: __ccgo_ts + 23412, } var _aOp1 = [5]int32{ @@ -145941,6 +148069,7 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse v2 = _windowArgCount(tls, pWin) } nArg = v2 + addrIf = 0 /* All OVER clauses in the same window function aggregate step must ** be the same. */ i = 0 @@ -145959,6 +148088,12 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse i++ } regArg = reg + if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { + regTmp = _sqlite3GetTempReg(tls, pParse) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), csr, (*TWindow)(unsafe.Pointer(pWin)).FiArgCol+nArg, regTmp) + addrIf = _sqlite3VdbeAddOp3(tls, v, int32(OP_IfNot), regTmp, 0, int32(1)) + _sqlite3ReleaseTempReg(tls, pParse, regTmp) + } if (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid == 0 && (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { addrIsNull = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), regArg) if bInverse == 0 { @@ -145977,13 +148112,6 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), (*TWindow)(unsafe.Pointer(pWin)).FregApp+int32(1)-bInverse, int32(1)) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc != __ccgo_fp(_noopStepFunc) { - addrIf = 0 - if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - regTmp = _sqlite3GetTempReg(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), csr, (*TWindow)(unsafe.Pointer(pWin)).FiArgCol+nArg, regTmp) - addrIf = _sqlite3VdbeAddOp3(tls, v, int32(OP_IfNot), regTmp, 0, int32(1)) - _sqlite3ReleaseTempReg(tls, pParse, regTmp) - } if (*TWindow)(unsafe.Pointer(pWin)).FbExprArgs != 0 { iOp = _sqlite3VdbeCurrentAddr(tls, v) nArg = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)))).FnExpr @@ -146015,16 +148143,16 @@ func _windowAggStep(tls *libc.TLS, p uintptr, pMWin uintptr, csr int32, bInverse } _sqlite3VdbeAddOp3(tls, v, v5, bInverse, regArg, (*TWindow)(unsafe.Pointer(pWin)).FregAccum) _sqlite3VdbeAppendP4(tls, v, pFunc, -int32(7)) - _sqlite3VdbeChangeP5(tls, v, uint16(libc.Uint8FromInt32(nArg))) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(nArg)) if (*TWindow)(unsafe.Pointer(pWin)).FbExprArgs != 0 { _sqlite3ReleaseTempRange(tls, pParse, regArg, nArg) } - if addrIf != 0 { - _sqlite3VdbeJumpHere(tls, v, addrIf) - } } } } + if addrIf != 0 { + _sqlite3VdbeJumpHere(tls, v, addrIf) + } goto _1 _1: ; @@ -146313,7 +148441,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nArg + *(*int32)(unsafe.Pointer(pParse + 60)) += nArg return regArg } @@ -146409,7 +148537,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 56 + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -146485,7 +148613,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal ** the add/subtract is skipped for these, as required. If reg1 is a NULL, ** then the arithmetic is performed, but since adding or subtracting from ** NULL is always NULL anyway, this case is handled as required too. */ - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1662, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1663, -int32(1)) addrGe = _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, 0, reg1) if op == int32(OP_Ge) && arith == int32(OP_Add) || op == int32(OP_Le) && arith == int32(OP_Subtract) { _sqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) @@ -147075,16 +149203,16 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr, addr1, addrBreak, addrBreak1, addrBreak2, addrBreak3, addrEmpty, addrGe, addrGosubFlush, addrInteger, addrNe, addrNext, addrStart, addrStart1, bRPS, bRPS1, csrInput, csrWrite, iInput, lbl, lbl1, lblWhereEnd, nInput, nPart, nPeer, op, pKeyInfo, pMWin, pOrderBy, pPart, regEnd, regFlushPart, regNew, regNewPart, regNewPeer, regPeer, regRecord, regStart, v, v1, v11, v12, v13, v14, v15, v2, v3, v4, v5, v6, v7, v8, v9 pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin pOrderBy = (*TWindow)(unsafe.Pointer(pMWin)).FpOrderBy - v = _sqlite3GetVdbe(tls, pParse) /* Cursor used to write to eph. table */ - csrInput = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FiCursor /* Cursor of sub-select */ - nInput = int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpTab)).FnCol) /* Address of OP_Ne */ - addrGosubFlush = 0 /* Address of OP_Gosub to flush: */ - addrInteger = 0 /* regNew array in record form */ - regNewPeer = 0 /* Peer values for new row (part of regNew) */ - regPeer = 0 /* Peer values for current row */ - regFlushPart = 0 /* Label just before sqlite3WhereEnd() code */ - regStart = 0 /* Value of <expr> PRECEDING */ - regEnd = 0 /* Value of <expr> FOLLOWING */ + v = _sqlite3GetVdbe(tls, pParse) /* Cursor used to write to eph. table */ + csrInput = (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FiCursor /* Cursor of sub-select */ + nInput = int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab)).FnCol) /* Address of OP_Ne */ + addrGosubFlush = 0 /* Address of OP_Gosub to flush: */ + addrInteger = 0 /* regNew array in record form */ + regNewPeer = 0 /* Peer values for new row (part of regNew) */ + regPeer = 0 /* Peer values for current row */ + regFlushPart = 0 /* Label just before sqlite3WhereEnd() code */ + regStart = 0 /* Value of <expr> PRECEDING */ + regEnd = 0 /* Value of <expr> FOLLOWING */ lblWhereEnd = _sqlite3VdbeMakeLabel(tls, pParse) /* Fill in the context object */ libc.Xmemset(tls, bp, 0, uint64(72)) @@ -147126,12 +149254,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nInput - v2 = pParse + 56 + *(*int32)(unsafe.Pointer(pParse + 60)) += nInput + v2 = pParse + 60 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 56 + v4 = pParse + 60 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -147139,13 +149267,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** <expr>. */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 56 + v6 = pParse + 60 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 56 + v8 = pParse + 60 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -147165,13 +149293,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 56)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -147198,7 +149326,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 56 + v12 = pParse + 60 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -147472,6 +149600,17 @@ type FrameBound = TFrameBound // C documentation // // /* +// ** Generate a syntax error +// */ +func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { + bp := tls.Alloc(16) + defer tls.Free(16) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23462, libc.VaList(bp+8, p)) +} + +// C documentation +// +// /* // ** Disable lookaside memory allocation for objects that might be // ** shared across database connections. // */ @@ -147513,11 +149652,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23381 + v1 = __ccgo_ts + 23486 } else { - v1 = __ccgo_ts + 23390 + v1 = __ccgo_ts + 23495 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23396, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23501, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -147526,7 +149665,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23438, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23543, 0) } } } @@ -147632,7 +149771,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23472, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23577, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -147704,27 +149843,27 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId // /************* Begin control #defines *****************************************/ type TYYMINORTYPE = struct { Fyy0 [0]TToken - Fyy14 [0]uintptr - Fyy59 [0]uintptr - Fyy67 [0]uintptr - Fyy122 [0]uintptr - Fyy132 [0]uintptr - Fyy144 [0]int32 - Fyy168 [0]uintptr - Fyy203 [0]uintptr - Fyy211 [0]uintptr - Fyy269 [0]TOnOrUsing - Fyy286 [0]TTrigEvent - Fyy383 [0]struct { + Fyy9 [0]Tu32 + Fyy28 [0]TTrigEvent + Fyy125 [0]uintptr + Fyy204 [0]uintptr + Fyy205 [0]TFrameBound + Fyy319 [0]uintptr + Fyy342 [0]uintptr + Fyy361 [0]uintptr + Fyy402 [0]uintptr + Fyy403 [0]uintptr + Fyy421 [0]TOnOrUsing + Fyy444 [0]Tu8 + Fyy481 [0]struct { Fvalue int32 Fmask int32 } - Fyy391 [0]Tu32 - Fyy427 [0]uintptr - Fyy454 [0]uintptr - Fyy462 [0]Tu8 - Fyy509 [0]TFrameBound - Fyy555 [0]uintptr + Fyy483 [0]uintptr + Fyy502 [0]int32 + Fyy563 [0]uintptr + Fyy590 [0]uintptr + Fyy637 [0]uintptr Fyyinit int32 F__ccgo_pad20 [12]byte } @@ -147801,2198 +149940,2263 @@ type YYMINORTYPE = TYYMINORTYPE // ** yy_default[] Default action for each state. // ** // *********** Begin parsing tables **********************************************/ -var _yy_action = [2142]uint16{ - 0: uint16(576), - 1: uint16(128), - 2: uint16(125), - 3: uint16(232), - 4: uint16(1622), - 5: uint16(549), +var _yy_action = [2207]uint16{ + 0: uint16(130), + 1: uint16(127), + 2: uint16(234), + 3: uint16(282), + 4: uint16(282), + 5: uint16(1328), 6: uint16(576), - 7: uint16(1290), - 8: uint16(1281), - 9: uint16(576), - 10: uint16(328), + 7: uint16(1307), + 8: uint16(460), + 9: uint16(289), + 10: uint16(289), 11: uint16(576), - 12: uint16(1300), - 13: uint16(212), + 12: uint16(1622), + 13: uint16(381), 14: uint16(576), - 15: uint16(128), - 16: uint16(125), - 17: uint16(232), - 18: uint16(578), - 19: uint16(412), - 20: uint16(578), - 21: uint16(391), - 22: uint16(1542), - 23: uint16(51), - 24: uint16(51), - 25: uint16(523), - 26: uint16(405), - 27: uint16(1293), - 28: uint16(529), - 29: uint16(51), - 30: uint16(51), + 15: uint16(1328), + 16: uint16(573), + 17: uint16(576), + 18: uint16(562), + 19: uint16(413), + 20: uint16(1300), + 21: uint16(1542), + 22: uint16(573), + 23: uint16(481), + 24: uint16(562), + 25: uint16(524), + 26: uint16(460), + 27: uint16(459), + 28: uint16(558), + 29: uint16(82), + 30: uint16(82), 31: uint16(983), - 32: uint16(51), - 33: uint16(51), - 34: uint16(81), - 35: uint16(81), - 36: uint16(1107), + 32: uint16(294), + 33: uint16(375), + 34: uint16(51), + 35: uint16(51), + 36: uint16(498), 37: uint16(61), 38: uint16(61), 39: uint16(984), - 40: uint16(1107), - 41: uint16(1292), - 42: uint16(380), - 43: uint16(135), - 44: uint16(136), - 45: uint16(90), - 46: uint16(1228), + 40: uint16(82), + 41: uint16(82), + 42: uint16(1577), + 43: uint16(137), + 44: uint16(138), + 45: uint16(91), + 46: uint16(7), 47: uint16(1228), - 48: uint16(1063), - 49: uint16(1066), - 50: uint16(1053), + 48: uint16(1228), + 49: uint16(1063), + 50: uint16(1066), 51: uint16(1053), - 52: uint16(133), - 53: uint16(133), - 54: uint16(134), - 55: uint16(134), - 56: uint16(134), - 57: uint16(134), - 58: uint16(1577), - 59: uint16(412), - 60: uint16(287), - 61: uint16(287), - 62: uint16(7), - 63: uint16(287), - 64: uint16(287), - 65: uint16(422), - 66: uint16(1050), - 67: uint16(1050), - 68: uint16(1064), - 69: uint16(1067), - 70: uint16(289), - 71: uint16(556), - 72: uint16(492), + 52: uint16(1053), + 53: uint16(135), + 54: uint16(135), + 55: uint16(136), + 56: uint16(136), + 57: uint16(136), + 58: uint16(136), + 59: uint16(413), + 60: uint16(288), + 61: uint16(288), + 62: uint16(182), + 63: uint16(288), + 64: uint16(288), + 65: uint16(481), + 66: uint16(536), + 67: uint16(288), + 68: uint16(288), + 69: uint16(130), + 70: uint16(127), + 71: uint16(234), + 72: uint16(432), 73: uint16(573), - 74: uint16(524), - 75: uint16(561), + 74: uint16(525), + 75: uint16(562), 76: uint16(573), - 77: uint16(497), - 78: uint16(561), - 79: uint16(482), - 80: uint16(530), - 81: uint16(262), - 82: uint16(229), - 83: uint16(135), - 84: uint16(136), - 85: uint16(90), - 86: uint16(1228), + 77: uint16(557), + 78: uint16(562), + 79: uint16(1290), + 80: uint16(573), + 81: uint16(421), + 82: uint16(562), + 83: uint16(137), + 84: uint16(138), + 85: uint16(91), + 86: uint16(559), 87: uint16(1228), - 88: uint16(1063), - 89: uint16(1066), - 90: uint16(1053), + 88: uint16(1228), + 89: uint16(1063), + 90: uint16(1066), 91: uint16(1053), - 92: uint16(133), - 93: uint16(133), - 94: uint16(134), - 95: uint16(134), - 96: uint16(134), - 97: uint16(134), - 98: uint16(128), - 99: uint16(125), - 100: uint16(232), - 101: uint16(1506), - 102: uint16(132), - 103: uint16(132), - 104: uint16(132), - 105: uint16(132), - 106: uint16(131), - 107: uint16(131), - 108: uint16(130), - 109: uint16(130), - 110: uint16(130), - 111: uint16(129), - 112: uint16(126), - 113: uint16(450), - 114: uint16(1204), - 115: uint16(1255), - 116: uint16(1), - 117: uint16(1), - 118: uint16(582), - 119: uint16(2), - 120: uint16(1259), - 121: uint16(1571), - 122: uint16(420), - 123: uint16(1582), - 124: uint16(379), - 125: uint16(320), - 126: uint16(1174), - 127: uint16(153), - 128: uint16(1174), - 129: uint16(1584), - 130: uint16(412), - 131: uint16(378), - 132: uint16(1582), - 133: uint16(543), - 134: uint16(1341), - 135: uint16(330), - 136: uint16(111), - 137: uint16(570), - 138: uint16(570), - 139: uint16(570), - 140: uint16(293), - 141: uint16(1054), - 142: uint16(132), - 143: uint16(132), - 144: uint16(132), - 145: uint16(132), - 146: uint16(131), - 147: uint16(131), - 148: uint16(130), - 149: uint16(130), - 150: uint16(130), - 151: uint16(129), - 152: uint16(126), - 153: uint16(450), - 154: uint16(135), - 155: uint16(136), - 156: uint16(90), - 157: uint16(1228), - 158: uint16(1228), - 159: uint16(1063), - 160: uint16(1066), - 161: uint16(1053), - 162: uint16(1053), - 163: uint16(133), - 164: uint16(133), - 165: uint16(134), - 166: uint16(134), - 167: uint16(134), - 168: uint16(134), - 169: uint16(287), - 170: uint16(287), + 92: uint16(1053), + 93: uint16(135), + 94: uint16(135), + 95: uint16(136), + 96: uint16(136), + 97: uint16(136), + 98: uint16(136), + 99: uint16(296), + 100: uint16(460), + 101: uint16(398), + 102: uint16(1249), + 103: uint16(134), + 104: uint16(134), + 105: uint16(134), + 106: uint16(134), + 107: uint16(133), + 108: uint16(133), + 109: uint16(132), + 110: uint16(132), + 111: uint16(132), + 112: uint16(131), + 113: uint16(128), + 114: uint16(451), + 115: uint16(451), + 116: uint16(1050), + 117: uint16(1050), + 118: uint16(1064), + 119: uint16(1067), + 120: uint16(1255), + 121: uint16(1), + 122: uint16(1), + 123: uint16(582), + 124: uint16(2), + 125: uint16(1259), + 126: uint16(581), + 127: uint16(1174), + 128: uint16(1259), + 129: uint16(1174), + 130: uint16(321), + 131: uint16(413), + 132: uint16(155), + 133: uint16(321), + 134: uint16(1584), + 135: uint16(155), + 136: uint16(379), + 137: uint16(112), + 138: uint16(481), + 139: uint16(1341), + 140: uint16(456), + 141: uint16(299), + 142: uint16(1341), + 143: uint16(134), + 144: uint16(134), + 145: uint16(134), + 146: uint16(134), + 147: uint16(133), + 148: uint16(133), + 149: uint16(132), + 150: uint16(132), + 151: uint16(132), + 152: uint16(131), + 153: uint16(128), + 154: uint16(451), + 155: uint16(137), + 156: uint16(138), + 157: uint16(91), + 158: uint16(498), + 159: uint16(1228), + 160: uint16(1228), + 161: uint16(1063), + 162: uint16(1066), + 163: uint16(1053), + 164: uint16(1053), + 165: uint16(135), + 166: uint16(135), + 167: uint16(136), + 168: uint16(136), + 169: uint16(136), + 170: uint16(136), 171: uint16(1204), - 172: uint16(1205), - 173: uint16(1204), - 174: uint16(255), - 175: uint16(287), - 176: uint16(287), - 177: uint16(510), - 178: uint16(507), - 179: uint16(506), - 180: uint16(137), - 181: uint16(455), - 182: uint16(573), - 183: uint16(212), - 184: uint16(561), - 185: uint16(447), - 186: uint16(446), - 187: uint16(505), - 188: uint16(573), - 189: uint16(1616), - 190: uint16(561), - 191: uint16(134), - 192: uint16(134), - 193: uint16(134), - 194: uint16(134), - 195: uint16(127), - 196: uint16(400), - 197: uint16(243), - 198: uint16(132), - 199: uint16(132), - 200: uint16(132), - 201: uint16(132), - 202: uint16(131), - 203: uint16(131), - 204: uint16(130), - 205: uint16(130), - 206: uint16(130), - 207: uint16(129), - 208: uint16(126), - 209: uint16(450), - 210: uint16(282), - 211: uint16(471), - 212: uint16(345), - 213: uint16(132), - 214: uint16(132), - 215: uint16(132), - 216: uint16(132), - 217: uint16(131), - 218: uint16(131), - 219: uint16(130), - 220: uint16(130), - 221: uint16(130), - 222: uint16(129), - 223: uint16(126), - 224: uint16(450), - 225: uint16(574), - 226: uint16(155), - 227: uint16(936), - 228: uint16(936), - 229: uint16(454), - 230: uint16(227), - 231: uint16(521), - 232: uint16(1236), - 233: uint16(412), - 234: uint16(1236), - 235: uint16(134), - 236: uint16(134), - 237: uint16(134), - 238: uint16(134), - 239: uint16(132), - 240: uint16(132), - 241: uint16(132), - 242: uint16(132), - 243: uint16(131), - 244: uint16(131), - 245: uint16(130), - 246: uint16(130), - 247: uint16(130), - 248: uint16(129), - 249: uint16(126), - 250: uint16(450), - 251: uint16(130), - 252: uint16(130), - 253: uint16(130), - 254: uint16(129), - 255: uint16(126), - 256: uint16(450), - 257: uint16(135), - 258: uint16(136), - 259: uint16(90), - 260: uint16(1228), - 261: uint16(1228), - 262: uint16(1063), - 263: uint16(1066), - 264: uint16(1053), - 265: uint16(1053), - 266: uint16(133), - 267: uint16(133), - 268: uint16(134), - 269: uint16(134), - 270: uint16(134), - 271: uint16(134), - 272: uint16(128), - 273: uint16(125), - 274: uint16(232), - 275: uint16(450), + 172: uint16(862), + 173: uint16(1281), + 174: uint16(288), + 175: uint16(288), + 176: uint16(283), + 177: uint16(288), + 178: uint16(288), + 179: uint16(523), + 180: uint16(523), + 181: uint16(1250), + 182: uint16(139), + 183: uint16(578), + 184: uint16(7), + 185: uint16(578), + 186: uint16(1345), + 187: uint16(573), + 188: uint16(1169), + 189: uint16(562), + 190: uint16(573), + 191: uint16(1054), + 192: uint16(562), + 193: uint16(136), + 194: uint16(136), + 195: uint16(136), + 196: uint16(136), + 197: uint16(129), + 198: uint16(573), + 199: uint16(547), + 200: uint16(562), + 201: uint16(1169), + 202: uint16(245), + 203: uint16(1541), + 204: uint16(1169), + 205: uint16(245), + 206: uint16(133), + 207: uint16(133), + 208: uint16(132), + 209: uint16(132), + 210: uint16(132), + 211: uint16(131), + 212: uint16(128), + 213: uint16(451), + 214: uint16(302), + 215: uint16(134), + 216: uint16(134), + 217: uint16(134), + 218: uint16(134), + 219: uint16(133), + 220: uint16(133), + 221: uint16(132), + 222: uint16(132), + 223: uint16(132), + 224: uint16(131), + 225: uint16(128), + 226: uint16(451), + 227: uint16(1575), + 228: uint16(1204), + 229: uint16(1205), + 230: uint16(1204), + 231: uint16(7), + 232: uint16(470), + 233: uint16(550), + 234: uint16(455), + 235: uint16(413), + 236: uint16(550), + 237: uint16(455), + 238: uint16(130), + 239: uint16(127), + 240: uint16(234), + 241: uint16(134), + 242: uint16(134), + 243: uint16(134), + 244: uint16(134), + 245: uint16(133), + 246: uint16(133), + 247: uint16(132), + 248: uint16(132), + 249: uint16(132), + 250: uint16(131), + 251: uint16(128), + 252: uint16(451), + 253: uint16(136), + 254: uint16(136), + 255: uint16(136), + 256: uint16(136), + 257: uint16(538), + 258: uint16(483), + 259: uint16(137), + 260: uint16(138), + 261: uint16(91), + 262: uint16(1019), + 263: uint16(1228), + 264: uint16(1228), + 265: uint16(1063), + 266: uint16(1066), + 267: uint16(1053), + 268: uint16(1053), + 269: uint16(135), + 270: uint16(135), + 271: uint16(136), + 272: uint16(136), + 273: uint16(136), + 274: uint16(136), + 275: uint16(1085), 276: uint16(576), - 277: uint16(412), - 278: uint16(397), - 279: uint16(1249), - 280: uint16(180), - 281: uint16(92), - 282: uint16(93), - 283: uint16(132), - 284: uint16(132), - 285: uint16(132), - 286: uint16(132), - 287: uint16(131), - 288: uint16(131), - 289: uint16(130), - 290: uint16(130), - 291: uint16(130), - 292: uint16(129), - 293: uint16(126), - 294: uint16(450), - 295: uint16(381), - 296: uint16(387), - 297: uint16(1204), - 298: uint16(383), - 299: uint16(81), - 300: uint16(81), - 301: uint16(135), - 302: uint16(136), - 303: uint16(90), - 304: uint16(1228), - 305: uint16(1228), - 306: uint16(1063), - 307: uint16(1066), - 308: uint16(1053), - 309: uint16(1053), - 310: uint16(133), - 311: uint16(133), - 312: uint16(134), - 313: uint16(134), - 314: uint16(134), - 315: uint16(134), - 316: uint16(132), - 317: uint16(132), - 318: uint16(132), - 319: uint16(132), - 320: uint16(131), - 321: uint16(131), - 322: uint16(130), - 323: uint16(130), - 324: uint16(130), - 325: uint16(129), - 326: uint16(126), - 327: uint16(450), + 277: uint16(1204), + 278: uint16(132), + 279: uint16(132), + 280: uint16(132), + 281: uint16(131), + 282: uint16(128), + 283: uint16(451), + 284: uint16(93), + 285: uint16(214), + 286: uint16(134), + 287: uint16(134), + 288: uint16(134), + 289: uint16(134), + 290: uint16(133), + 291: uint16(133), + 292: uint16(132), + 293: uint16(132), + 294: uint16(132), + 295: uint16(131), + 296: uint16(128), + 297: uint16(451), + 298: uint16(401), + 299: uint16(19), + 300: uint16(19), + 301: uint16(134), + 302: uint16(134), + 303: uint16(134), + 304: uint16(134), + 305: uint16(133), + 306: uint16(133), + 307: uint16(132), + 308: uint16(132), + 309: uint16(132), + 310: uint16(131), + 311: uint16(128), + 312: uint16(451), + 313: uint16(1498), + 314: uint16(426), + 315: uint16(267), + 316: uint16(344), + 317: uint16(467), + 318: uint16(332), + 319: uint16(134), + 320: uint16(134), + 321: uint16(134), + 322: uint16(134), + 323: uint16(133), + 324: uint16(133), + 325: uint16(132), + 326: uint16(132), + 327: uint16(132), 328: uint16(131), - 329: uint16(131), - 330: uint16(130), - 331: uint16(130), - 332: uint16(130), - 333: uint16(129), - 334: uint16(126), - 335: uint16(450), - 336: uint16(556), - 337: uint16(1204), - 338: uint16(302), - 339: uint16(319), - 340: uint16(567), - 341: uint16(121), - 342: uint16(568), - 343: uint16(480), - 344: uint16(4), - 345: uint16(555), - 346: uint16(1149), - 347: uint16(1657), - 348: uint16(1628), - 349: uint16(1657), - 350: uint16(45), - 351: uint16(128), - 352: uint16(125), - 353: uint16(232), - 354: uint16(1204), - 355: uint16(1205), - 356: uint16(1204), - 357: uint16(1250), - 358: uint16(571), - 359: uint16(1169), - 360: uint16(132), - 361: uint16(132), - 362: uint16(132), - 363: uint16(132), - 364: uint16(131), - 365: uint16(131), - 366: uint16(130), - 367: uint16(130), - 368: uint16(130), - 369: uint16(129), - 370: uint16(126), - 371: uint16(450), - 372: uint16(1169), - 373: uint16(287), - 374: uint16(287), - 375: uint16(1169), - 376: uint16(1019), - 377: uint16(576), - 378: uint16(422), - 379: uint16(1019), - 380: uint16(412), - 381: uint16(451), - 382: uint16(1602), - 383: uint16(582), - 384: uint16(2), - 385: uint16(1259), - 386: uint16(573), - 387: uint16(44), - 388: uint16(561), - 389: uint16(95), - 390: uint16(320), - 391: uint16(110), - 392: uint16(153), - 393: uint16(565), - 394: uint16(1204), - 395: uint16(1205), - 396: uint16(1204), - 397: uint16(522), - 398: uint16(522), - 399: uint16(1341), - 400: uint16(81), - 401: uint16(81), - 402: uint16(7), - 403: uint16(44), - 404: uint16(135), - 405: uint16(136), - 406: uint16(90), - 407: uint16(1228), - 408: uint16(1228), - 409: uint16(1063), - 410: uint16(1066), - 411: uint16(1053), - 412: uint16(1053), - 413: uint16(133), - 414: uint16(133), - 415: uint16(134), - 416: uint16(134), - 417: uint16(134), - 418: uint16(134), - 419: uint16(295), - 420: uint16(1149), - 421: uint16(1658), - 422: uint16(1040), - 423: uint16(1658), - 424: uint16(1204), - 425: uint16(1147), - 426: uint16(319), - 427: uint16(567), - 428: uint16(119), - 429: uint16(119), - 430: uint16(343), - 431: uint16(466), - 432: uint16(331), - 433: uint16(343), - 434: uint16(287), - 435: uint16(287), - 436: uint16(120), - 437: uint16(556), - 438: uint16(451), - 439: uint16(577), - 440: uint16(451), - 441: uint16(1169), - 442: uint16(1169), - 443: uint16(1028), - 444: uint16(319), - 445: uint16(567), - 446: uint16(438), - 447: uint16(573), - 448: uint16(210), - 449: uint16(561), - 450: uint16(1339), - 451: uint16(1451), - 452: uint16(546), - 453: uint16(531), - 454: uint16(1169), - 455: uint16(1169), - 456: uint16(1598), - 457: uint16(1169), - 458: uint16(1169), - 459: uint16(416), - 460: uint16(319), - 461: uint16(567), - 462: uint16(243), - 463: uint16(132), - 464: uint16(132), - 465: uint16(132), - 466: uint16(132), - 467: uint16(131), - 468: uint16(131), - 469: uint16(130), - 470: uint16(130), - 471: uint16(130), - 472: uint16(129), - 473: uint16(126), - 474: uint16(450), - 475: uint16(1028), - 476: uint16(1028), - 477: uint16(1030), - 478: uint16(1031), - 479: uint16(35), - 480: uint16(44), - 481: uint16(1204), - 482: uint16(1205), - 483: uint16(1204), - 484: uint16(472), - 485: uint16(287), - 486: uint16(287), - 487: uint16(1328), - 488: uint16(412), - 489: uint16(1307), - 490: uint16(372), - 491: uint16(1595), - 492: uint16(359), - 493: uint16(225), - 494: uint16(454), - 495: uint16(1204), - 496: uint16(195), - 497: uint16(1328), - 498: uint16(573), - 499: uint16(1147), - 500: uint16(561), - 501: uint16(1333), - 502: uint16(1333), - 503: uint16(274), - 504: uint16(576), - 505: uint16(1188), - 506: uint16(576), - 507: uint16(340), - 508: uint16(46), - 509: uint16(196), - 510: uint16(537), - 511: uint16(217), - 512: uint16(135), - 513: uint16(136), - 514: uint16(90), - 515: uint16(1228), - 516: uint16(1228), - 517: uint16(1063), - 518: uint16(1066), - 519: uint16(1053), - 520: uint16(1053), - 521: uint16(133), - 522: uint16(133), - 523: uint16(134), - 524: uint16(134), - 525: uint16(134), - 526: uint16(134), - 527: uint16(19), - 528: uint16(19), - 529: uint16(19), - 530: uint16(19), - 531: uint16(412), - 532: uint16(581), - 533: uint16(1204), - 534: uint16(1259), - 535: uint16(511), - 536: uint16(1204), - 537: uint16(319), - 538: uint16(567), - 539: uint16(320), - 540: uint16(944), - 541: uint16(153), - 542: uint16(425), - 543: uint16(491), - 544: uint16(430), - 545: uint16(943), - 546: uint16(1204), - 547: uint16(488), - 548: uint16(1341), - 549: uint16(1450), - 550: uint16(532), - 551: uint16(1277), - 552: uint16(1204), - 553: uint16(1205), - 554: uint16(1204), - 555: uint16(135), - 556: uint16(136), - 557: uint16(90), - 558: uint16(1228), - 559: uint16(1228), - 560: uint16(1063), - 561: uint16(1066), - 562: uint16(1053), - 563: uint16(1053), - 564: uint16(133), - 565: uint16(133), - 566: uint16(134), - 567: uint16(134), - 568: uint16(134), - 569: uint16(134), - 570: uint16(575), - 571: uint16(132), - 572: uint16(132), - 573: uint16(132), - 574: uint16(132), - 575: uint16(131), - 576: uint16(131), - 577: uint16(130), - 578: uint16(130), - 579: uint16(130), - 580: uint16(129), - 581: uint16(126), - 582: uint16(450), - 583: uint16(287), - 584: uint16(287), - 585: uint16(528), - 586: uint16(287), - 587: uint16(287), - 588: uint16(372), - 589: uint16(1595), - 590: uint16(1204), - 591: uint16(1205), - 592: uint16(1204), - 593: uint16(1204), - 594: uint16(1205), - 595: uint16(1204), - 596: uint16(573), - 597: uint16(486), - 598: uint16(561), - 599: uint16(573), - 600: uint16(889), - 601: uint16(561), - 602: uint16(412), - 603: uint16(1204), - 604: uint16(1205), - 605: uint16(1204), - 606: uint16(886), - 607: uint16(40), - 608: uint16(22), - 609: uint16(22), - 610: uint16(220), - 611: uint16(243), - 612: uint16(525), - 613: uint16(1449), - 614: uint16(132), - 615: uint16(132), - 616: uint16(132), - 617: uint16(132), - 618: uint16(131), - 619: uint16(131), - 620: uint16(130), - 621: uint16(130), - 622: uint16(130), - 623: uint16(129), - 624: uint16(126), - 625: uint16(450), - 626: uint16(135), - 627: uint16(136), - 628: uint16(90), - 629: uint16(1228), - 630: uint16(1228), - 631: uint16(1063), - 632: uint16(1066), - 633: uint16(1053), - 634: uint16(1053), - 635: uint16(133), - 636: uint16(133), - 637: uint16(134), - 638: uint16(134), - 639: uint16(134), - 640: uint16(134), - 641: uint16(412), - 642: uint16(180), - 643: uint16(454), - 644: uint16(1204), - 645: uint16(879), - 646: uint16(255), - 647: uint16(287), - 648: uint16(287), - 649: uint16(510), - 650: uint16(507), - 651: uint16(506), - 652: uint16(372), + 329: uint16(128), + 330: uint16(451), + 331: uint16(1281), + 332: uint16(576), + 333: uint16(6), + 334: uint16(1204), + 335: uint16(1205), + 336: uint16(1204), + 337: uint16(257), + 338: uint16(576), + 339: uint16(413), + 340: uint16(511), + 341: uint16(508), + 342: uint16(507), + 343: uint16(1279), + 344: uint16(94), + 345: uint16(1019), + 346: uint16(464), + 347: uint16(1204), + 348: uint16(551), + 349: uint16(551), + 350: uint16(506), + 351: uint16(1224), + 352: uint16(1571), + 353: uint16(44), + 354: uint16(38), + 355: uint16(51), + 356: uint16(51), + 357: uint16(411), + 358: uint16(576), + 359: uint16(413), + 360: uint16(45), + 361: uint16(51), + 362: uint16(51), + 363: uint16(137), + 364: uint16(138), + 365: uint16(91), + 366: uint16(530), + 367: uint16(1228), + 368: uint16(1228), + 369: uint16(1063), + 370: uint16(1066), + 371: uint16(1053), + 372: uint16(1053), + 373: uint16(135), + 374: uint16(135), + 375: uint16(136), + 376: uint16(136), + 377: uint16(136), + 378: uint16(136), + 379: uint16(398), + 380: uint16(1148), + 381: uint16(82), + 382: uint16(82), + 383: uint16(137), + 384: uint16(138), + 385: uint16(91), + 386: uint16(39), + 387: uint16(1228), + 388: uint16(1228), + 389: uint16(1063), + 390: uint16(1066), + 391: uint16(1053), + 392: uint16(1053), + 393: uint16(135), + 394: uint16(135), + 395: uint16(136), + 396: uint16(136), + 397: uint16(136), + 398: uint16(136), + 399: uint16(344), + 400: uint16(44), + 401: uint16(288), + 402: uint16(288), + 403: uint16(375), + 404: uint16(1204), + 405: uint16(1205), + 406: uint16(1204), + 407: uint16(209), + 408: uint16(1204), + 409: uint16(1224), + 410: uint16(320), + 411: uint16(567), + 412: uint16(471), + 413: uint16(576), + 414: uint16(573), + 415: uint16(576), + 416: uint16(562), + 417: uint16(576), + 418: uint16(316), + 419: uint16(264), + 420: uint16(231), + 421: uint16(46), + 422: uint16(160), + 423: uint16(134), + 424: uint16(134), + 425: uint16(134), + 426: uint16(134), + 427: uint16(133), + 428: uint16(133), + 429: uint16(132), + 430: uint16(132), + 431: uint16(132), + 432: uint16(131), + 433: uint16(128), + 434: uint16(451), + 435: uint16(303), + 436: uint16(82), + 437: uint16(82), + 438: uint16(82), + 439: uint16(82), + 440: uint16(82), + 441: uint16(82), + 442: uint16(442), + 443: uint16(134), + 444: uint16(134), + 445: uint16(134), + 446: uint16(134), + 447: uint16(133), + 448: uint16(133), + 449: uint16(132), + 450: uint16(132), + 451: uint16(132), + 452: uint16(131), + 453: uint16(128), + 454: uint16(451), + 455: uint16(1582), + 456: uint16(544), + 457: uint16(320), + 458: uint16(567), + 459: uint16(1250), + 460: uint16(874), + 461: uint16(1582), + 462: uint16(380), + 463: uint16(382), + 464: uint16(413), + 465: uint16(1204), + 466: uint16(1205), + 467: uint16(1204), + 468: uint16(360), + 469: uint16(182), + 470: uint16(288), + 471: uint16(288), + 472: uint16(1576), + 473: uint16(557), + 474: uint16(1339), + 475: uint16(557), + 476: uint16(7), + 477: uint16(557), + 478: uint16(1277), + 479: uint16(472), + 480: uint16(346), + 481: uint16(526), + 482: uint16(531), + 483: uint16(573), + 484: uint16(556), + 485: uint16(562), + 486: uint16(439), + 487: uint16(1511), + 488: uint16(137), + 489: uint16(138), + 490: uint16(91), + 491: uint16(219), + 492: uint16(1228), + 493: uint16(1228), + 494: uint16(1063), + 495: uint16(1066), + 496: uint16(1053), + 497: uint16(1053), + 498: uint16(135), + 499: uint16(135), + 500: uint16(136), + 501: uint16(136), + 502: uint16(136), + 503: uint16(136), + 504: uint16(465), + 505: uint16(1511), + 506: uint16(1513), + 507: uint16(532), + 508: uint16(413), + 509: uint16(288), + 510: uint16(288), + 511: uint16(423), + 512: uint16(512), + 513: uint16(288), + 514: uint16(288), + 515: uint16(411), + 516: uint16(288), + 517: uint16(288), + 518: uint16(874), + 519: uint16(130), + 520: uint16(127), + 521: uint16(234), + 522: uint16(573), + 523: uint16(1107), + 524: uint16(562), + 525: uint16(1204), + 526: uint16(573), + 527: uint16(1107), + 528: uint16(562), + 529: uint16(573), + 530: uint16(560), + 531: uint16(562), + 532: uint16(137), + 533: uint16(138), + 534: uint16(91), + 535: uint16(1293), + 536: uint16(1228), + 537: uint16(1228), + 538: uint16(1063), + 539: uint16(1066), + 540: uint16(1053), + 541: uint16(1053), + 542: uint16(135), + 543: uint16(135), + 544: uint16(136), + 545: uint16(136), + 546: uint16(136), + 547: uint16(136), + 548: uint16(134), + 549: uint16(134), + 550: uint16(134), + 551: uint16(134), + 552: uint16(133), + 553: uint16(133), + 554: uint16(132), + 555: uint16(132), + 556: uint16(132), + 557: uint16(131), + 558: uint16(128), + 559: uint16(451), + 560: uint16(493), + 561: uint16(503), + 562: uint16(1292), + 563: uint16(1204), + 564: uint16(257), + 565: uint16(288), + 566: uint16(288), + 567: uint16(511), + 568: uint16(508), + 569: uint16(507), + 570: uint16(1204), + 571: uint16(1628), + 572: uint16(1169), + 573: uint16(123), + 574: uint16(568), + 575: uint16(275), + 576: uint16(4), + 577: uint16(506), + 578: uint16(573), + 579: uint16(1511), + 580: uint16(562), + 581: uint16(331), + 582: uint16(1204), + 583: uint16(1205), + 584: uint16(1204), + 585: uint16(1169), + 586: uint16(548), + 587: uint16(548), + 588: uint16(1169), + 589: uint16(261), + 590: uint16(571), + 591: uint16(7), + 592: uint16(134), + 593: uint16(134), + 594: uint16(134), + 595: uint16(134), + 596: uint16(133), + 597: uint16(133), + 598: uint16(132), + 599: uint16(132), + 600: uint16(132), + 601: uint16(131), + 602: uint16(128), + 603: uint16(451), + 604: uint16(108), + 605: uint16(533), + 606: uint16(130), + 607: uint16(127), + 608: uint16(234), + 609: uint16(1204), + 610: uint16(448), + 611: uint16(447), + 612: uint16(413), + 613: uint16(1451), + 614: uint16(452), + 615: uint16(983), + 616: uint16(886), + 617: uint16(96), + 618: uint16(1598), + 619: uint16(1233), + 620: uint16(1204), + 621: uint16(1205), + 622: uint16(1204), + 623: uint16(984), + 624: uint16(1235), + 625: uint16(1450), + 626: uint16(565), + 627: uint16(1204), + 628: uint16(1205), + 629: uint16(1204), + 630: uint16(229), + 631: uint16(522), + 632: uint16(1234), + 633: uint16(534), + 634: uint16(1333), + 635: uint16(1333), + 636: uint16(137), + 637: uint16(138), + 638: uint16(91), + 639: uint16(1449), + 640: uint16(1228), + 641: uint16(1228), + 642: uint16(1063), + 643: uint16(1066), + 644: uint16(1053), + 645: uint16(1053), + 646: uint16(135), + 647: uint16(135), + 648: uint16(136), + 649: uint16(136), + 650: uint16(136), + 651: uint16(136), + 652: uint16(373), 653: uint16(1595), - 654: uint16(1568), - 655: uint16(1331), - 656: uint16(1331), - 657: uint16(576), - 658: uint16(889), - 659: uint16(505), - 660: uint16(573), - 661: uint16(44), - 662: uint16(561), - 663: uint16(559), - 664: uint16(1207), - 665: uint16(135), - 666: uint16(136), - 667: uint16(90), - 668: uint16(1228), - 669: uint16(1228), - 670: uint16(1063), - 671: uint16(1066), - 672: uint16(1053), - 673: uint16(1053), - 674: uint16(133), - 675: uint16(133), - 676: uint16(134), - 677: uint16(134), - 678: uint16(134), - 679: uint16(134), - 680: uint16(81), - 681: uint16(81), - 682: uint16(422), - 683: uint16(576), - 684: uint16(377), - 685: uint16(132), - 686: uint16(132), - 687: uint16(132), - 688: uint16(132), - 689: uint16(131), - 690: uint16(131), - 691: uint16(130), - 692: uint16(130), - 693: uint16(130), - 694: uint16(129), - 695: uint16(126), - 696: uint16(450), - 697: uint16(297), - 698: uint16(287), - 699: uint16(287), - 700: uint16(460), - 701: uint16(1204), - 702: uint16(1205), - 703: uint16(1204), - 704: uint16(1204), - 705: uint16(534), - 706: uint16(19), - 707: uint16(19), - 708: uint16(448), - 709: uint16(448), - 710: uint16(448), - 711: uint16(573), - 712: uint16(412), - 713: uint16(561), - 714: uint16(230), - 715: uint16(436), - 716: uint16(1187), - 717: uint16(535), - 718: uint16(319), - 719: uint16(567), - 720: uint16(363), - 721: uint16(432), - 722: uint16(1207), - 723: uint16(1435), - 724: uint16(132), - 725: uint16(132), - 726: uint16(132), - 727: uint16(132), - 728: uint16(131), - 729: uint16(131), - 730: uint16(130), - 731: uint16(130), - 732: uint16(130), - 733: uint16(129), - 734: uint16(126), - 735: uint16(450), - 736: uint16(135), - 737: uint16(136), - 738: uint16(90), - 739: uint16(1228), - 740: uint16(1228), - 741: uint16(1063), - 742: uint16(1066), - 743: uint16(1053), - 744: uint16(1053), + 654: uint16(971), + 655: uint16(1040), + 656: uint16(413), + 657: uint16(1236), + 658: uint16(418), + 659: uint16(1236), + 660: uint16(879), + 661: uint16(121), + 662: uint16(121), + 663: uint16(948), + 664: uint16(373), + 665: uint16(1595), + 666: uint16(1204), + 667: uint16(1205), + 668: uint16(1204), + 669: uint16(122), + 670: uint16(1204), + 671: uint16(452), + 672: uint16(577), + 673: uint16(452), + 674: uint16(363), + 675: uint16(417), + 676: uint16(1028), + 677: uint16(882), + 678: uint16(373), + 679: uint16(1595), + 680: uint16(137), + 681: uint16(138), + 682: uint16(91), + 683: uint16(462), + 684: uint16(1228), + 685: uint16(1228), + 686: uint16(1063), + 687: uint16(1066), + 688: uint16(1053), + 689: uint16(1053), + 690: uint16(135), + 691: uint16(135), + 692: uint16(136), + 693: uint16(136), + 694: uint16(136), + 695: uint16(136), + 696: uint16(134), + 697: uint16(134), + 698: uint16(134), + 699: uint16(134), + 700: uint16(133), + 701: uint16(133), + 702: uint16(132), + 703: uint16(132), + 704: uint16(132), + 705: uint16(131), + 706: uint16(128), + 707: uint16(451), + 708: uint16(1028), + 709: uint16(1028), + 710: uint16(1030), + 711: uint16(1031), + 712: uint16(35), + 713: uint16(570), + 714: uint16(570), + 715: uint16(570), + 716: uint16(197), + 717: uint16(423), + 718: uint16(1040), + 719: uint16(198), + 720: uint16(1204), + 721: uint16(123), + 722: uint16(568), + 723: uint16(1204), + 724: uint16(4), + 725: uint16(320), + 726: uint16(567), + 727: uint16(1204), + 728: uint16(1205), + 729: uint16(1204), + 730: uint16(40), + 731: uint16(388), + 732: uint16(576), + 733: uint16(384), + 734: uint16(882), + 735: uint16(1029), + 736: uint16(423), + 737: uint16(1188), + 738: uint16(571), + 739: uint16(1028), + 740: uint16(134), + 741: uint16(134), + 742: uint16(134), + 743: uint16(134), + 744: uint16(133), 745: uint16(133), - 746: uint16(133), - 747: uint16(134), - 748: uint16(134), - 749: uint16(134), - 750: uint16(134), - 751: uint16(412), - 752: uint16(211), - 753: uint16(949), - 754: uint16(1169), - 755: uint16(1041), - 756: uint16(1110), - 757: uint16(1110), - 758: uint16(494), - 759: uint16(547), - 760: uint16(547), - 761: uint16(1204), - 762: uint16(1205), - 763: uint16(1204), - 764: uint16(7), - 765: uint16(539), - 766: uint16(1570), - 767: uint16(1169), - 768: uint16(376), - 769: uint16(576), - 770: uint16(1169), - 771: uint16(5), - 772: uint16(1204), - 773: uint16(486), - 774: uint16(3), - 775: uint16(135), - 776: uint16(136), - 777: uint16(90), - 778: uint16(1228), - 779: uint16(1228), - 780: uint16(1063), - 781: uint16(1066), - 782: uint16(1053), - 783: uint16(1053), - 784: uint16(133), - 785: uint16(133), - 786: uint16(134), - 787: uint16(134), - 788: uint16(134), - 789: uint16(134), - 790: uint16(576), - 791: uint16(513), - 792: uint16(19), - 793: uint16(19), - 794: uint16(427), - 795: uint16(132), - 796: uint16(132), - 797: uint16(132), - 798: uint16(132), - 799: uint16(131), - 800: uint16(131), - 801: uint16(130), - 802: uint16(130), - 803: uint16(130), - 804: uint16(129), - 805: uint16(126), - 806: uint16(450), - 807: uint16(305), - 808: uint16(1204), - 809: uint16(433), - 810: uint16(225), + 746: uint16(132), + 747: uint16(132), + 748: uint16(132), + 749: uint16(131), + 750: uint16(128), + 751: uint16(451), + 752: uint16(529), + 753: uint16(1568), + 754: uint16(1204), + 755: uint16(19), + 756: uint16(19), + 757: uint16(1204), + 758: uint16(575), + 759: uint16(492), + 760: uint16(413), + 761: uint16(157), + 762: uint16(452), + 763: uint16(489), + 764: uint16(1187), + 765: uint16(1331), + 766: uint16(1331), + 767: uint16(5), + 768: uint16(1204), + 769: uint16(949), + 770: uint16(431), + 771: uint16(1028), + 772: uint16(1028), + 773: uint16(1030), + 774: uint16(565), + 775: uint16(22), + 776: uint16(22), + 777: uint16(1204), + 778: uint16(1205), + 779: uint16(1204), + 780: uint16(1204), + 781: uint16(1205), + 782: uint16(1204), + 783: uint16(477), + 784: uint16(137), + 785: uint16(138), + 786: uint16(91), + 787: uint16(212), + 788: uint16(1228), + 789: uint16(1228), + 790: uint16(1063), + 791: uint16(1066), + 792: uint16(1053), + 793: uint16(1053), + 794: uint16(135), + 795: uint16(135), + 796: uint16(136), + 797: uint16(136), + 798: uint16(136), + 799: uint16(136), + 800: uint16(1188), + 801: uint16(48), + 802: uint16(111), + 803: uint16(1040), + 804: uint16(413), + 805: uint16(1204), + 806: uint16(213), + 807: uint16(970), + 808: uint16(1041), + 809: uint16(121), + 810: uint16(121), 811: uint16(1204), - 812: uint16(385), - 813: uint16(19), - 814: uint16(19), - 815: uint16(273), - 816: uint16(290), - 817: uint16(371), - 818: uint16(516), - 819: uint16(366), - 820: uint16(515), - 821: uint16(260), - 822: uint16(412), - 823: uint16(538), - 824: uint16(1568), - 825: uint16(549), - 826: uint16(1024), - 827: uint16(362), - 828: uint16(437), - 829: uint16(1204), - 830: uint16(1205), - 831: uint16(1204), - 832: uint16(902), - 833: uint16(1552), - 834: uint16(132), - 835: uint16(132), - 836: uint16(132), - 837: uint16(132), - 838: uint16(131), - 839: uint16(131), - 840: uint16(130), - 841: uint16(130), - 842: uint16(130), - 843: uint16(129), - 844: uint16(126), - 845: uint16(450), - 846: uint16(135), - 847: uint16(136), - 848: uint16(90), - 849: uint16(1228), - 850: uint16(1228), - 851: uint16(1063), - 852: uint16(1066), - 853: uint16(1053), - 854: uint16(1053), - 855: uint16(133), - 856: uint16(133), - 857: uint16(134), - 858: uint16(134), - 859: uint16(134), - 860: uint16(134), - 861: uint16(412), - 862: uint16(1435), - 863: uint16(514), - 864: uint16(1281), - 865: uint16(1204), - 866: uint16(1205), - 867: uint16(1204), - 868: uint16(1204), - 869: uint16(1205), - 870: uint16(1204), - 871: uint16(903), - 872: uint16(48), - 873: uint16(342), - 874: uint16(1568), - 875: uint16(1568), - 876: uint16(1279), - 877: uint16(1627), - 878: uint16(1568), - 879: uint16(911), - 880: uint16(576), - 881: uint16(129), - 882: uint16(126), - 883: uint16(450), - 884: uint16(110), - 885: uint16(135), - 886: uint16(136), - 887: uint16(90), - 888: uint16(1228), - 889: uint16(1228), - 890: uint16(1063), - 891: uint16(1066), - 892: uint16(1053), - 893: uint16(1053), - 894: uint16(133), - 895: uint16(133), - 896: uint16(134), - 897: uint16(134), - 898: uint16(134), - 899: uint16(134), - 900: uint16(265), - 901: uint16(576), - 902: uint16(459), - 903: uint16(19), - 904: uint16(19), - 905: uint16(132), - 906: uint16(132), - 907: uint16(132), - 908: uint16(132), - 909: uint16(131), - 910: uint16(131), - 911: uint16(130), - 912: uint16(130), - 913: uint16(130), - 914: uint16(129), - 915: uint16(126), - 916: uint16(450), - 917: uint16(1345), - 918: uint16(204), - 919: uint16(576), - 920: uint16(459), - 921: uint16(458), - 922: uint16(50), - 923: uint16(47), - 924: uint16(19), - 925: uint16(19), - 926: uint16(49), - 927: uint16(434), - 928: uint16(1105), - 929: uint16(573), - 930: uint16(497), - 931: uint16(561), - 932: uint16(412), - 933: uint16(428), - 934: uint16(108), - 935: uint16(1224), - 936: uint16(1569), - 937: uint16(1554), - 938: uint16(376), - 939: uint16(205), - 940: uint16(550), - 941: uint16(550), - 942: uint16(81), - 943: uint16(81), - 944: uint16(132), - 945: uint16(132), - 946: uint16(132), - 947: uint16(132), - 948: uint16(131), - 949: uint16(131), - 950: uint16(130), - 951: uint16(130), - 952: uint16(130), - 953: uint16(129), - 954: uint16(126), - 955: uint16(450), - 956: uint16(135), - 957: uint16(136), - 958: uint16(90), - 959: uint16(1228), - 960: uint16(1228), - 961: uint16(1063), - 962: uint16(1066), - 963: uint16(1053), - 964: uint16(1053), - 965: uint16(133), - 966: uint16(133), - 967: uint16(134), - 968: uint16(134), - 969: uint16(134), - 970: uint16(134), - 971: uint16(480), - 972: uint16(576), - 973: uint16(1204), - 974: uint16(576), - 975: uint16(1541), - 976: uint16(412), - 977: uint16(1435), - 978: uint16(969), - 979: uint16(315), - 980: uint16(1659), - 981: uint16(398), - 982: uint16(284), - 983: uint16(497), - 984: uint16(969), - 985: uint16(893), - 986: uint16(1569), - 987: uint16(1569), - 988: uint16(376), - 989: uint16(376), - 990: uint16(1569), - 991: uint16(461), - 992: uint16(376), - 993: uint16(1224), - 994: uint16(459), - 995: uint16(80), - 996: uint16(80), - 997: uint16(81), - 998: uint16(81), - 999: uint16(497), - 1000: uint16(374), - 1001: uint16(114), - 1002: uint16(90), - 1003: uint16(1228), - 1004: uint16(1228), - 1005: uint16(1063), - 1006: uint16(1066), - 1007: uint16(1053), - 1008: uint16(1053), - 1009: uint16(133), - 1010: uint16(133), - 1011: uint16(134), + 812: uint16(1205), + 813: uint16(1204), + 814: uint16(1204), + 815: uint16(1205), + 816: uint16(1204), + 817: uint16(122), + 818: uint16(221), + 819: uint16(452), + 820: uint16(577), + 821: uint16(452), + 822: uint16(44), + 823: uint16(487), + 824: uint16(1028), + 825: uint16(1204), + 826: uint16(1205), + 827: uint16(1204), + 828: uint16(137), + 829: uint16(138), + 830: uint16(91), + 831: uint16(378), + 832: uint16(1228), + 833: uint16(1228), + 834: uint16(1063), + 835: uint16(1066), + 836: uint16(1053), + 837: uint16(1053), + 838: uint16(135), + 839: uint16(135), + 840: uint16(136), + 841: uint16(136), + 842: uint16(136), + 843: uint16(136), + 844: uint16(134), + 845: uint16(134), + 846: uint16(134), + 847: uint16(134), + 848: uint16(133), + 849: uint16(133), + 850: uint16(132), + 851: uint16(132), + 852: uint16(132), + 853: uint16(131), + 854: uint16(128), + 855: uint16(451), + 856: uint16(1028), + 857: uint16(1028), + 858: uint16(1030), + 859: uint16(1031), + 860: uint16(35), + 861: uint16(461), + 862: uint16(1204), + 863: uint16(1205), + 864: uint16(1204), + 865: uint16(1569), + 866: uint16(1040), + 867: uint16(377), + 868: uint16(214), + 869: uint16(1149), + 870: uint16(1657), + 871: uint16(535), + 872: uint16(1657), + 873: uint16(437), + 874: uint16(902), + 875: uint16(320), + 876: uint16(567), + 877: uint16(1568), + 878: uint16(364), + 879: uint16(320), + 880: uint16(567), + 881: uint16(412), + 882: uint16(329), + 883: uint16(1029), + 884: uint16(519), + 885: uint16(1188), + 886: uint16(3), + 887: uint16(1028), + 888: uint16(134), + 889: uint16(134), + 890: uint16(134), + 891: uint16(134), + 892: uint16(133), + 893: uint16(133), + 894: uint16(132), + 895: uint16(132), + 896: uint16(132), + 897: uint16(131), + 898: uint16(128), + 899: uint16(451), + 900: uint16(1659), + 901: uint16(399), + 902: uint16(1169), + 903: uint16(307), + 904: uint16(893), + 905: uint16(307), + 906: uint16(515), + 907: uint16(576), + 908: uint16(413), + 909: uint16(214), + 910: uint16(498), + 911: uint16(944), + 912: uint16(1024), + 913: uint16(540), + 914: uint16(903), + 915: uint16(1169), + 916: uint16(943), + 917: uint16(392), + 918: uint16(1169), + 919: uint16(1028), + 920: uint16(1028), + 921: uint16(1030), + 922: uint16(406), + 923: uint16(298), + 924: uint16(1204), + 925: uint16(50), + 926: uint16(1149), + 927: uint16(1658), + 928: uint16(413), + 929: uint16(1658), + 930: uint16(145), + 931: uint16(145), + 932: uint16(137), + 933: uint16(138), + 934: uint16(91), + 935: uint16(293), + 936: uint16(1228), + 937: uint16(1228), + 938: uint16(1063), + 939: uint16(1066), + 940: uint16(1053), + 941: uint16(1053), + 942: uint16(135), + 943: uint16(135), + 944: uint16(136), + 945: uint16(136), + 946: uint16(136), + 947: uint16(136), + 948: uint16(1188), + 949: uint16(1147), + 950: uint16(514), + 951: uint16(1568), + 952: uint16(137), + 953: uint16(138), + 954: uint16(91), + 955: uint16(1505), + 956: uint16(1228), + 957: uint16(1228), + 958: uint16(1063), + 959: uint16(1066), + 960: uint16(1053), + 961: uint16(1053), + 962: uint16(135), + 963: uint16(135), + 964: uint16(136), + 965: uint16(136), + 966: uint16(136), + 967: uint16(136), + 968: uint16(434), + 969: uint16(323), + 970: uint16(435), + 971: uint16(539), + 972: uint16(111), + 973: uint16(1506), + 974: uint16(274), + 975: uint16(291), + 976: uint16(372), + 977: uint16(517), + 978: uint16(367), + 979: uint16(516), + 980: uint16(262), + 981: uint16(1204), + 982: uint16(1205), + 983: uint16(1204), + 984: uint16(1574), + 985: uint16(481), + 986: uint16(363), + 987: uint16(576), + 988: uint16(7), + 989: uint16(1569), + 990: uint16(1568), + 991: uint16(377), + 992: uint16(134), + 993: uint16(134), + 994: uint16(134), + 995: uint16(134), + 996: uint16(133), + 997: uint16(133), + 998: uint16(132), + 999: uint16(132), + 1000: uint16(132), + 1001: uint16(131), + 1002: uint16(128), + 1003: uint16(451), + 1004: uint16(1568), + 1005: uint16(576), + 1006: uint16(1147), + 1007: uint16(576), + 1008: uint16(232), + 1009: uint16(576), + 1010: uint16(19), + 1011: uint16(19), 1012: uint16(134), 1013: uint16(134), 1014: uint16(134), - 1015: uint16(132), - 1016: uint16(132), - 1017: uint16(132), + 1015: uint16(134), + 1016: uint16(133), + 1017: uint16(133), 1018: uint16(132), - 1019: uint16(131), - 1020: uint16(131), - 1021: uint16(130), - 1022: uint16(130), - 1023: uint16(130), - 1024: uint16(129), - 1025: uint16(126), - 1026: uint16(450), - 1027: uint16(1204), - 1028: uint16(1505), - 1029: uint16(576), - 1030: uint16(1204), - 1031: uint16(1205), - 1032: uint16(1204), - 1033: uint16(1366), - 1034: uint16(316), - 1035: uint16(486), - 1036: uint16(281), - 1037: uint16(281), - 1038: uint16(497), - 1039: uint16(431), - 1040: uint16(557), - 1041: uint16(288), - 1042: uint16(288), - 1043: uint16(402), - 1044: uint16(1340), - 1045: uint16(471), - 1046: uint16(345), - 1047: uint16(298), - 1048: uint16(429), - 1049: uint16(573), - 1050: uint16(576), - 1051: uint16(561), - 1052: uint16(81), - 1053: uint16(81), - 1054: uint16(573), - 1055: uint16(374), - 1056: uint16(561), - 1057: uint16(971), - 1058: uint16(386), - 1059: uint16(132), - 1060: uint16(132), - 1061: uint16(132), - 1062: uint16(132), - 1063: uint16(131), - 1064: uint16(131), - 1065: uint16(130), - 1066: uint16(130), - 1067: uint16(130), - 1068: uint16(129), - 1069: uint16(126), - 1070: uint16(450), - 1071: uint16(231), - 1072: uint16(117), - 1073: uint16(81), - 1074: uint16(81), - 1075: uint16(287), - 1076: uint16(287), - 1077: uint16(231), - 1078: uint16(287), - 1079: uint16(287), - 1080: uint16(576), - 1081: uint16(1511), + 1019: uint16(132), + 1020: uint16(132), + 1021: uint16(131), + 1022: uint16(128), + 1023: uint16(451), + 1024: uint16(1169), + 1025: uint16(433), + 1026: uint16(576), + 1027: uint16(1207), + 1028: uint16(19), + 1029: uint16(19), + 1030: uint16(19), + 1031: uint16(19), + 1032: uint16(19), + 1033: uint16(19), + 1034: uint16(1627), + 1035: uint16(576), + 1036: uint16(911), + 1037: uint16(1169), + 1038: uint16(47), + 1039: uint16(120), + 1040: uint16(1169), + 1041: uint16(117), + 1042: uint16(413), + 1043: uint16(306), + 1044: uint16(498), + 1045: uint16(438), + 1046: uint16(1125), + 1047: uint16(206), + 1048: uint16(336), + 1049: uint16(19), + 1050: uint16(19), + 1051: uint16(1435), + 1052: uint16(49), + 1053: uint16(449), + 1054: uint16(449), + 1055: uint16(449), + 1056: uint16(1368), + 1057: uint16(315), + 1058: uint16(81), + 1059: uint16(81), + 1060: uint16(576), + 1061: uint16(304), + 1062: uint16(413), + 1063: uint16(1570), + 1064: uint16(207), + 1065: uint16(377), + 1066: uint16(137), + 1067: uint16(138), + 1068: uint16(91), + 1069: uint16(115), + 1070: uint16(1228), + 1071: uint16(1228), + 1072: uint16(1063), + 1073: uint16(1066), + 1074: uint16(1053), + 1075: uint16(1053), + 1076: uint16(135), + 1077: uint16(135), + 1078: uint16(136), + 1079: uint16(136), + 1080: uint16(136), + 1081: uint16(136), 1082: uint16(576), - 1083: uint16(1336), - 1084: uint16(1204), - 1085: uint16(1205), - 1086: uint16(1204), - 1087: uint16(139), - 1088: uint16(573), - 1089: uint16(556), - 1090: uint16(561), - 1091: uint16(573), - 1092: uint16(412), - 1093: uint16(561), - 1094: uint16(441), - 1095: uint16(456), - 1096: uint16(969), - 1097: uint16(213), - 1098: uint16(558), - 1099: uint16(1511), - 1100: uint16(1513), - 1101: uint16(1550), - 1102: uint16(969), - 1103: uint16(143), - 1104: uint16(143), - 1105: uint16(145), - 1106: uint16(145), - 1107: uint16(1368), - 1108: uint16(314), - 1109: uint16(478), - 1110: uint16(444), - 1111: uint16(970), - 1112: uint16(412), - 1113: uint16(850), - 1114: uint16(851), - 1115: uint16(852), - 1116: uint16(135), - 1117: uint16(136), - 1118: uint16(90), - 1119: uint16(1228), - 1120: uint16(1228), - 1121: uint16(1063), - 1122: uint16(1066), - 1123: uint16(1053), - 1124: uint16(1053), - 1125: uint16(133), - 1126: uint16(133), + 1083: uint16(82), + 1084: uint16(82), + 1085: uint16(1207), + 1086: uint16(137), + 1087: uint16(138), + 1088: uint16(91), + 1089: uint16(1340), + 1090: uint16(1228), + 1091: uint16(1228), + 1092: uint16(1063), + 1093: uint16(1066), + 1094: uint16(1053), + 1095: uint16(1053), + 1096: uint16(135), + 1097: uint16(135), + 1098: uint16(136), + 1099: uint16(136), + 1100: uint16(136), + 1101: uint16(136), + 1102: uint16(1569), + 1103: uint16(386), + 1104: uint16(377), + 1105: uint16(82), + 1106: uint16(82), + 1107: uint16(463), + 1108: uint16(1126), + 1109: uint16(1552), + 1110: uint16(333), + 1111: uint16(463), + 1112: uint16(335), + 1113: uint16(131), + 1114: uint16(128), + 1115: uint16(451), + 1116: uint16(1569), + 1117: uint16(161), + 1118: uint16(377), + 1119: uint16(16), + 1120: uint16(317), + 1121: uint16(387), + 1122: uint16(428), + 1123: uint16(1127), + 1124: uint16(448), + 1125: uint16(447), + 1126: uint16(134), 1127: uint16(134), 1128: uint16(134), 1129: uint16(134), - 1130: uint16(134), - 1131: uint16(357), - 1132: uint16(412), - 1133: uint16(397), - 1134: uint16(1148), - 1135: uint16(304), - 1136: uint16(135), - 1137: uint16(136), - 1138: uint16(90), - 1139: uint16(1228), - 1140: uint16(1228), - 1141: uint16(1063), - 1142: uint16(1066), - 1143: uint16(1053), - 1144: uint16(1053), - 1145: uint16(133), - 1146: uint16(133), + 1130: uint16(133), + 1131: uint16(133), + 1132: uint16(132), + 1133: uint16(132), + 1134: uint16(132), + 1135: uint16(131), + 1136: uint16(128), + 1137: uint16(451), + 1138: uint16(1128), + 1139: uint16(576), + 1140: uint16(1105), + 1141: uint16(10), + 1142: uint16(445), + 1143: uint16(267), + 1144: uint16(576), + 1145: uint16(1554), + 1146: uint16(134), 1147: uint16(134), 1148: uint16(134), 1149: uint16(134), - 1150: uint16(134), - 1151: uint16(1575), - 1152: uint16(323), - 1153: uint16(6), - 1154: uint16(862), - 1155: uint16(7), - 1156: uint16(135), - 1157: uint16(124), - 1158: uint16(90), - 1159: uint16(1228), - 1160: uint16(1228), - 1161: uint16(1063), - 1162: uint16(1066), - 1163: uint16(1053), - 1164: uint16(1053), - 1165: uint16(133), - 1166: uint16(133), - 1167: uint16(134), - 1168: uint16(134), - 1169: uint16(134), - 1170: uint16(134), - 1171: uint16(409), - 1172: uint16(408), - 1173: uint16(1511), - 1174: uint16(212), - 1175: uint16(132), - 1176: uint16(132), - 1177: uint16(132), - 1178: uint16(132), - 1179: uint16(131), - 1180: uint16(131), - 1181: uint16(130), - 1182: uint16(130), - 1183: uint16(130), - 1184: uint16(129), - 1185: uint16(126), - 1186: uint16(450), - 1187: uint16(411), - 1188: uint16(118), - 1189: uint16(1204), - 1190: uint16(116), - 1191: uint16(10), - 1192: uint16(352), - 1193: uint16(265), - 1194: uint16(355), - 1195: uint16(132), - 1196: uint16(132), - 1197: uint16(132), - 1198: uint16(132), - 1199: uint16(131), - 1200: uint16(131), - 1201: uint16(130), - 1202: uint16(130), - 1203: uint16(130), - 1204: uint16(129), - 1205: uint16(126), - 1206: uint16(450), - 1207: uint16(576), - 1208: uint16(324), - 1209: uint16(306), - 1210: uint16(576), - 1211: uint16(306), - 1212: uint16(1250), - 1213: uint16(469), - 1214: uint16(158), - 1215: uint16(132), - 1216: uint16(132), - 1217: uint16(132), - 1218: uint16(132), - 1219: uint16(131), - 1220: uint16(131), - 1221: uint16(130), - 1222: uint16(130), - 1223: uint16(130), - 1224: uint16(129), - 1225: uint16(126), - 1226: uint16(450), - 1227: uint16(207), - 1228: uint16(1224), - 1229: uint16(1126), - 1230: uint16(65), - 1231: uint16(65), - 1232: uint16(470), - 1233: uint16(66), - 1234: uint16(66), - 1235: uint16(412), - 1236: uint16(447), - 1237: uint16(446), - 1238: uint16(882), - 1239: uint16(531), - 1240: uint16(335), - 1241: uint16(258), - 1242: uint16(257), - 1243: uint16(256), - 1244: uint16(1127), - 1245: uint16(1233), - 1246: uint16(1204), - 1247: uint16(1205), - 1248: uint16(1204), - 1249: uint16(327), - 1250: uint16(1235), - 1251: uint16(874), - 1252: uint16(159), - 1253: uint16(576), - 1254: uint16(16), - 1255: uint16(480), - 1256: uint16(1085), - 1257: uint16(1040), - 1258: uint16(1234), - 1259: uint16(1128), - 1260: uint16(136), - 1261: uint16(90), - 1262: uint16(1228), - 1263: uint16(1228), - 1264: uint16(1063), - 1265: uint16(1066), - 1266: uint16(1053), - 1267: uint16(1053), - 1268: uint16(133), - 1269: uint16(133), - 1270: uint16(134), - 1271: uint16(134), - 1272: uint16(134), - 1273: uint16(134), - 1274: uint16(1029), - 1275: uint16(576), - 1276: uint16(81), - 1277: uint16(81), - 1278: uint16(1028), - 1279: uint16(1040), - 1280: uint16(922), - 1281: uint16(576), - 1282: uint16(463), - 1283: uint16(1236), - 1284: uint16(576), - 1285: uint16(1236), - 1286: uint16(1224), - 1287: uint16(502), - 1288: uint16(107), - 1289: uint16(1435), - 1290: uint16(923), - 1291: uint16(6), + 1150: uint16(133), + 1151: uint16(133), + 1152: uint16(132), + 1153: uint16(132), + 1154: uint16(132), + 1155: uint16(131), + 1156: uint16(128), + 1157: uint16(451), + 1158: uint16(532), + 1159: uint16(576), + 1160: uint16(922), + 1161: uint16(576), + 1162: uint16(19), + 1163: uint16(19), + 1164: uint16(576), + 1165: uint16(1573), + 1166: uint16(576), + 1167: uint16(147), + 1168: uint16(147), + 1169: uint16(7), + 1170: uint16(923), + 1171: uint16(1236), + 1172: uint16(498), + 1173: uint16(1236), + 1174: uint16(576), + 1175: uint16(487), + 1176: uint16(413), + 1177: uint16(552), + 1178: uint16(285), + 1179: uint16(1224), + 1180: uint16(969), + 1181: uint16(215), + 1182: uint16(82), + 1183: uint16(82), + 1184: uint16(66), + 1185: uint16(66), + 1186: uint16(1435), + 1187: uint16(67), + 1188: uint16(67), + 1189: uint16(21), + 1190: uint16(21), + 1191: uint16(1110), + 1192: uint16(1110), + 1193: uint16(495), + 1194: uint16(334), + 1195: uint16(297), + 1196: uint16(413), + 1197: uint16(53), + 1198: uint16(53), + 1199: uint16(297), + 1200: uint16(137), + 1201: uint16(138), + 1202: uint16(91), + 1203: uint16(119), + 1204: uint16(1228), + 1205: uint16(1228), + 1206: uint16(1063), + 1207: uint16(1066), + 1208: uint16(1053), + 1209: uint16(1053), + 1210: uint16(135), + 1211: uint16(135), + 1212: uint16(136), + 1213: uint16(136), + 1214: uint16(136), + 1215: uint16(136), + 1216: uint16(413), + 1217: uint16(1336), + 1218: uint16(1311), + 1219: uint16(446), + 1220: uint16(137), + 1221: uint16(138), + 1222: uint16(91), + 1223: uint16(227), + 1224: uint16(1228), + 1225: uint16(1228), + 1226: uint16(1063), + 1227: uint16(1066), + 1228: uint16(1053), + 1229: uint16(1053), + 1230: uint16(135), + 1231: uint16(135), + 1232: uint16(136), + 1233: uint16(136), + 1234: uint16(136), + 1235: uint16(136), + 1236: uint16(574), + 1237: uint16(1224), + 1238: uint16(936), + 1239: uint16(936), + 1240: uint16(137), + 1241: uint16(126), + 1242: uint16(91), + 1243: uint16(141), + 1244: uint16(1228), + 1245: uint16(1228), + 1246: uint16(1063), + 1247: uint16(1066), + 1248: uint16(1053), + 1249: uint16(1053), + 1250: uint16(135), + 1251: uint16(135), + 1252: uint16(136), + 1253: uint16(136), + 1254: uint16(136), + 1255: uint16(136), + 1256: uint16(533), + 1257: uint16(429), + 1258: uint16(472), + 1259: uint16(346), + 1260: uint16(134), + 1261: uint16(134), + 1262: uint16(134), + 1263: uint16(134), + 1264: uint16(133), + 1265: uint16(133), + 1266: uint16(132), + 1267: uint16(132), + 1268: uint16(132), + 1269: uint16(131), + 1270: uint16(128), + 1271: uint16(451), + 1272: uint16(576), + 1273: uint16(457), + 1274: uint16(233), + 1275: uint16(343), + 1276: uint16(1435), + 1277: uint16(403), + 1278: uint16(498), + 1279: uint16(1550), + 1280: uint16(134), + 1281: uint16(134), + 1282: uint16(134), + 1283: uint16(134), + 1284: uint16(133), + 1285: uint16(133), + 1286: uint16(132), + 1287: uint16(132), + 1288: uint16(132), + 1289: uint16(131), + 1290: uint16(128), + 1291: uint16(451), 1292: uint16(576), - 1293: uint16(410), - 1294: uint16(1498), - 1295: uint16(882), - 1296: uint16(1029), - 1297: uint16(480), - 1298: uint16(21), - 1299: uint16(21), - 1300: uint16(1028), - 1301: uint16(332), - 1302: uint16(1380), - 1303: uint16(334), - 1304: uint16(53), - 1305: uint16(53), - 1306: uint16(497), - 1307: uint16(81), - 1308: uint16(81), - 1309: uint16(874), - 1310: uint16(1028), - 1311: uint16(1028), - 1312: uint16(1030), - 1313: uint16(445), - 1314: uint16(259), - 1315: uint16(19), - 1316: uint16(19), - 1317: uint16(533), - 1318: uint16(132), - 1319: uint16(132), - 1320: uint16(132), - 1321: uint16(132), - 1322: uint16(131), - 1323: uint16(131), - 1324: uint16(130), - 1325: uint16(130), - 1326: uint16(130), - 1327: uint16(129), - 1328: uint16(126), - 1329: uint16(450), - 1330: uint16(551), - 1331: uint16(301), - 1332: uint16(1028), - 1333: uint16(1028), - 1334: uint16(1030), - 1335: uint16(107), - 1336: uint16(532), - 1337: uint16(545), - 1338: uint16(121), - 1339: uint16(568), - 1340: uint16(1188), - 1341: uint16(4), - 1342: uint16(1126), - 1343: uint16(1576), - 1344: uint16(449), - 1345: uint16(576), - 1346: uint16(462), - 1347: uint16(7), - 1348: uint16(1282), - 1349: uint16(418), - 1350: uint16(462), - 1351: uint16(350), - 1352: uint16(1435), - 1353: uint16(576), - 1354: uint16(518), - 1355: uint16(571), - 1356: uint16(544), - 1357: uint16(1127), - 1358: uint16(121), - 1359: uint16(568), - 1360: uint16(442), - 1361: uint16(4), - 1362: uint16(1188), - 1363: uint16(464), - 1364: uint16(533), - 1365: uint16(1180), - 1366: uint16(1223), - 1367: uint16(9), - 1368: uint16(67), - 1369: uint16(67), - 1370: uint16(487), - 1371: uint16(576), - 1372: uint16(1128), - 1373: uint16(303), - 1374: uint16(410), - 1375: uint16(571), - 1376: uint16(54), - 1377: uint16(54), - 1378: uint16(451), - 1379: uint16(576), - 1380: uint16(123), - 1381: uint16(944), - 1382: uint16(576), - 1383: uint16(417), - 1384: uint16(576), - 1385: uint16(333), - 1386: uint16(943), - 1387: uint16(1379), - 1388: uint16(576), - 1389: uint16(236), - 1390: uint16(565), - 1391: uint16(576), - 1392: uint16(1574), - 1393: uint16(564), - 1394: uint16(68), - 1395: uint16(68), - 1396: uint16(7), - 1397: uint16(576), - 1398: uint16(451), - 1399: uint16(362), - 1400: uint16(419), - 1401: uint16(182), - 1402: uint16(69), - 1403: uint16(69), - 1404: uint16(541), - 1405: uint16(70), - 1406: uint16(70), - 1407: uint16(71), - 1408: uint16(71), - 1409: uint16(540), - 1410: uint16(565), - 1411: uint16(72), - 1412: uint16(72), - 1413: uint16(484), - 1414: uint16(55), - 1415: uint16(55), - 1416: uint16(473), - 1417: uint16(1180), - 1418: uint16(296), - 1419: uint16(1040), - 1420: uint16(56), + 1293: uint16(324), + 1294: uint16(576), + 1295: uint16(82), + 1296: uint16(82), + 1297: uint16(487), + 1298: uint16(576), + 1299: uint16(969), + 1300: uint16(134), + 1301: uint16(134), + 1302: uint16(134), + 1303: uint16(134), + 1304: uint16(133), + 1305: uint16(133), + 1306: uint16(132), + 1307: uint16(132), + 1308: uint16(132), + 1309: uint16(131), + 1310: uint16(128), + 1311: uint16(451), + 1312: uint16(288), + 1313: uint16(288), + 1314: uint16(546), + 1315: uint16(68), + 1316: uint16(68), + 1317: uint16(54), + 1318: uint16(54), + 1319: uint16(553), + 1320: uint16(413), + 1321: uint16(69), + 1322: uint16(69), + 1323: uint16(351), + 1324: uint16(6), + 1325: uint16(573), + 1326: uint16(944), + 1327: uint16(562), + 1328: uint16(410), + 1329: uint16(409), + 1330: uint16(1435), + 1331: uint16(943), + 1332: uint16(450), + 1333: uint16(545), + 1334: uint16(260), + 1335: uint16(259), + 1336: uint16(258), + 1337: uint16(576), + 1338: uint16(158), + 1339: uint16(576), + 1340: uint16(413), + 1341: uint16(222), + 1342: uint16(1180), + 1343: uint16(479), + 1344: uint16(969), + 1345: uint16(138), + 1346: uint16(91), + 1347: uint16(430), + 1348: uint16(1228), + 1349: uint16(1228), + 1350: uint16(1063), + 1351: uint16(1066), + 1352: uint16(1053), + 1353: uint16(1053), + 1354: uint16(135), + 1355: uint16(135), + 1356: uint16(136), + 1357: uint16(136), + 1358: uint16(136), + 1359: uint16(136), + 1360: uint16(70), + 1361: uint16(70), + 1362: uint16(71), + 1363: uint16(71), + 1364: uint16(576), + 1365: uint16(1126), + 1366: uint16(91), + 1367: uint16(576), + 1368: uint16(1228), + 1369: uint16(1228), + 1370: uint16(1063), + 1371: uint16(1066), + 1372: uint16(1053), + 1373: uint16(1053), + 1374: uint16(135), + 1375: uint16(135), + 1376: uint16(136), + 1377: uint16(136), + 1378: uint16(136), + 1379: uint16(136), + 1380: uint16(1127), + 1381: uint16(166), + 1382: uint16(850), + 1383: uint16(851), + 1384: uint16(852), + 1385: uint16(1282), + 1386: uint16(419), + 1387: uint16(72), + 1388: uint16(72), + 1389: uint16(108), + 1390: uint16(73), + 1391: uint16(73), + 1392: uint16(1310), + 1393: uint16(358), + 1394: uint16(1180), + 1395: uint16(1128), + 1396: uint16(576), + 1397: uint16(305), + 1398: uint16(576), + 1399: uint16(123), + 1400: uint16(568), + 1401: uint16(494), + 1402: uint16(4), + 1403: uint16(488), + 1404: uint16(134), + 1405: uint16(134), + 1406: uint16(134), + 1407: uint16(134), + 1408: uint16(133), + 1409: uint16(133), + 1410: uint16(132), + 1411: uint16(132), + 1412: uint16(132), + 1413: uint16(131), + 1414: uint16(128), + 1415: uint16(451), + 1416: uint16(571), + 1417: uint16(564), + 1418: uint16(534), + 1419: uint16(55), + 1420: uint16(55), 1421: uint16(56), - 1422: uint16(296), - 1423: uint16(493), - 1424: uint16(541), - 1425: uint16(119), - 1426: uint16(119), - 1427: uint16(410), - 1428: uint16(1573), - 1429: uint16(542), - 1430: uint16(569), - 1431: uint16(418), - 1432: uint16(7), - 1433: uint16(120), - 1434: uint16(1244), + 1422: uint16(56), + 1423: uint16(576), + 1424: uint16(134), + 1425: uint16(134), + 1426: uint16(134), + 1427: uint16(134), + 1428: uint16(133), + 1429: uint16(133), + 1430: uint16(132), + 1431: uint16(132), + 1432: uint16(132), + 1433: uint16(131), + 1434: uint16(128), 1435: uint16(451), - 1436: uint16(577), - 1437: uint16(451), - 1438: uint16(465), - 1439: uint16(1040), - 1440: uint16(1028), - 1441: uint16(576), - 1442: uint16(1557), - 1443: uint16(552), - 1444: uint16(476), - 1445: uint16(119), - 1446: uint16(119), - 1447: uint16(527), - 1448: uint16(259), - 1449: uint16(121), - 1450: uint16(568), - 1451: uint16(240), - 1452: uint16(4), - 1453: uint16(120), - 1454: uint16(576), - 1455: uint16(451), - 1456: uint16(577), - 1457: uint16(451), - 1458: uint16(576), - 1459: uint16(477), - 1460: uint16(1028), + 1436: uint16(576), + 1437: uint16(1104), + 1438: uint16(233), + 1439: uint16(1104), + 1440: uint16(452), + 1441: uint16(1602), + 1442: uint16(582), + 1443: uint16(2), + 1444: uint16(1259), + 1445: uint16(576), + 1446: uint16(57), + 1447: uint16(57), + 1448: uint16(576), + 1449: uint16(321), + 1450: uint16(576), + 1451: uint16(155), + 1452: uint16(565), + 1453: uint16(1435), + 1454: uint16(485), + 1455: uint16(353), + 1456: uint16(576), + 1457: uint16(356), + 1458: uint16(1341), + 1459: uint16(59), + 1460: uint16(59), 1461: uint16(576), - 1462: uint16(156), - 1463: uint16(576), - 1464: uint16(57), - 1465: uint16(57), - 1466: uint16(571), - 1467: uint16(576), - 1468: uint16(286), - 1469: uint16(229), - 1470: uint16(410), - 1471: uint16(336), - 1472: uint16(1028), - 1473: uint16(1028), - 1474: uint16(1030), - 1475: uint16(1031), - 1476: uint16(35), - 1477: uint16(59), - 1478: uint16(59), - 1479: uint16(219), - 1480: uint16(983), - 1481: uint16(60), - 1482: uint16(60), - 1483: uint16(220), - 1484: uint16(73), - 1485: uint16(73), - 1486: uint16(74), - 1487: uint16(74), - 1488: uint16(984), - 1489: uint16(451), - 1490: uint16(75), - 1491: uint16(75), - 1492: uint16(1028), - 1493: uint16(1028), - 1494: uint16(1030), - 1495: uint16(1031), - 1496: uint16(35), - 1497: uint16(96), - 1498: uint16(216), - 1499: uint16(291), - 1500: uint16(552), - 1501: uint16(565), - 1502: uint16(1188), - 1503: uint16(318), - 1504: uint16(395), - 1505: uint16(395), - 1506: uint16(394), - 1507: uint16(276), - 1508: uint16(392), - 1509: uint16(576), - 1510: uint16(485), - 1511: uint16(859), - 1512: uint16(474), - 1513: uint16(1311), - 1514: uint16(410), - 1515: uint16(541), - 1516: uint16(576), - 1517: uint16(417), - 1518: uint16(1530), - 1519: uint16(1144), - 1520: uint16(540), - 1521: uint16(399), - 1522: uint16(1188), - 1523: uint16(292), - 1524: uint16(237), - 1525: uint16(1153), - 1526: uint16(326), - 1527: uint16(38), - 1528: uint16(23), - 1529: uint16(576), - 1530: uint16(1040), - 1531: uint16(576), - 1532: uint16(20), - 1533: uint16(20), - 1534: uint16(325), - 1535: uint16(299), - 1536: uint16(119), - 1537: uint16(119), - 1538: uint16(164), - 1539: uint16(76), - 1540: uint16(76), - 1541: uint16(1529), - 1542: uint16(121), - 1543: uint16(568), - 1544: uint16(120), - 1545: uint16(4), - 1546: uint16(451), - 1547: uint16(577), - 1548: uint16(451), - 1549: uint16(203), - 1550: uint16(576), - 1551: uint16(1028), - 1552: uint16(141), - 1553: uint16(141), - 1554: uint16(142), - 1555: uint16(142), - 1556: uint16(576), - 1557: uint16(322), - 1558: uint16(39), - 1559: uint16(571), - 1560: uint16(341), - 1561: uint16(1021), - 1562: uint16(110), - 1563: uint16(264), - 1564: uint16(239), - 1565: uint16(901), - 1566: uint16(900), - 1567: uint16(423), - 1568: uint16(242), - 1569: uint16(908), - 1570: uint16(909), - 1571: uint16(370), - 1572: uint16(173), - 1573: uint16(77), - 1574: uint16(77), - 1575: uint16(43), - 1576: uint16(479), - 1577: uint16(1310), - 1578: uint16(264), - 1579: uint16(62), - 1580: uint16(62), - 1581: uint16(369), - 1582: uint16(451), - 1583: uint16(1028), - 1584: uint16(1028), - 1585: uint16(1030), - 1586: uint16(1031), - 1587: uint16(35), - 1588: uint16(1601), - 1589: uint16(1192), - 1590: uint16(453), - 1591: uint16(1092), - 1592: uint16(238), - 1593: uint16(291), - 1594: uint16(565), - 1595: uint16(163), - 1596: uint16(1309), - 1597: uint16(110), - 1598: uint16(395), - 1599: uint16(395), - 1600: uint16(394), - 1601: uint16(276), - 1602: uint16(392), - 1603: uint16(986), - 1604: uint16(987), - 1605: uint16(859), - 1606: uint16(481), - 1607: uint16(346), - 1608: uint16(264), - 1609: uint16(110), - 1610: uint16(1032), - 1611: uint16(489), + 1462: uint16(44), + 1463: uint16(969), + 1464: uint16(569), + 1465: uint16(419), + 1466: uint16(576), + 1467: uint16(238), + 1468: uint16(60), + 1469: uint16(60), + 1470: uint16(261), + 1471: uint16(74), + 1472: uint16(74), + 1473: uint16(75), + 1474: uint16(75), + 1475: uint16(287), + 1476: uint16(231), + 1477: uint16(576), + 1478: uint16(1366), + 1479: uint16(76), + 1480: uint16(76), + 1481: uint16(1040), + 1482: uint16(420), + 1483: uint16(184), + 1484: uint16(20), + 1485: uint16(20), + 1486: uint16(576), + 1487: uint16(121), + 1488: uint16(121), + 1489: uint16(77), + 1490: uint16(77), + 1491: uint16(97), + 1492: uint16(218), + 1493: uint16(288), + 1494: uint16(288), + 1495: uint16(122), + 1496: uint16(125), + 1497: uint16(452), + 1498: uint16(577), + 1499: uint16(452), + 1500: uint16(143), + 1501: uint16(143), + 1502: uint16(1028), + 1503: uint16(576), + 1504: uint16(520), + 1505: uint16(576), + 1506: uint16(573), + 1507: uint16(576), + 1508: uint16(562), + 1509: uint16(144), + 1510: uint16(144), + 1511: uint16(474), + 1512: uint16(227), + 1513: uint16(1244), + 1514: uint16(478), + 1515: uint16(123), + 1516: uint16(568), + 1517: uint16(576), + 1518: uint16(4), + 1519: uint16(320), + 1520: uint16(567), + 1521: uint16(245), + 1522: uint16(411), + 1523: uint16(576), + 1524: uint16(443), + 1525: uint16(411), + 1526: uint16(78), + 1527: uint16(78), + 1528: uint16(62), + 1529: uint16(62), + 1530: uint16(79), + 1531: uint16(79), + 1532: uint16(571), + 1533: uint16(319), + 1534: uint16(1028), + 1535: uint16(1028), + 1536: uint16(1030), + 1537: uint16(1031), + 1538: uint16(35), + 1539: uint16(418), + 1540: uint16(63), + 1541: uint16(63), + 1542: uint16(576), + 1543: uint16(290), + 1544: uint16(411), + 1545: uint16(9), + 1546: uint16(80), + 1547: uint16(80), + 1548: uint16(1144), + 1549: uint16(576), + 1550: uint16(400), + 1551: uint16(576), + 1552: uint16(486), + 1553: uint16(455), + 1554: uint16(576), + 1555: uint16(1223), + 1556: uint16(452), + 1557: uint16(576), + 1558: uint16(325), + 1559: uint16(342), + 1560: uint16(576), + 1561: uint16(111), + 1562: uint16(576), + 1563: uint16(1188), + 1564: uint16(242), + 1565: uint16(64), + 1566: uint16(64), + 1567: uint16(473), + 1568: uint16(565), + 1569: uint16(576), + 1570: uint16(23), + 1571: uint16(576), + 1572: uint16(170), + 1573: uint16(170), + 1574: uint16(171), + 1575: uint16(171), + 1576: uint16(576), + 1577: uint16(87), + 1578: uint16(87), + 1579: uint16(328), + 1580: uint16(65), + 1581: uint16(65), + 1582: uint16(542), + 1583: uint16(83), + 1584: uint16(83), + 1585: uint16(146), + 1586: uint16(146), + 1587: uint16(541), + 1588: uint16(123), + 1589: uint16(568), + 1590: uint16(341), + 1591: uint16(4), + 1592: uint16(84), + 1593: uint16(84), + 1594: uint16(168), + 1595: uint16(168), + 1596: uint16(576), + 1597: uint16(1040), + 1598: uint16(576), + 1599: uint16(148), + 1600: uint16(148), + 1601: uint16(576), + 1602: uint16(1380), + 1603: uint16(121), + 1604: uint16(121), + 1605: uint16(571), + 1606: uint16(1021), + 1607: uint16(576), + 1608: uint16(266), + 1609: uint16(576), + 1610: uint16(424), + 1611: uint16(122), 1612: uint16(576), - 1613: uint16(1188), - 1614: uint16(503), - 1615: uint16(1088), - 1616: uint16(261), - 1617: uint16(261), - 1618: uint16(237), - 1619: uint16(576), - 1620: uint16(326), - 1621: uint16(121), - 1622: uint16(568), - 1623: uint16(1040), - 1624: uint16(4), - 1625: uint16(347), - 1626: uint16(1376), - 1627: uint16(413), - 1628: uint16(325), - 1629: uint16(119), - 1630: uint16(119), - 1631: uint16(948), - 1632: uint16(319), - 1633: uint16(567), - 1634: uint16(351), - 1635: uint16(78), - 1636: uint16(78), - 1637: uint16(120), - 1638: uint16(571), - 1639: uint16(451), - 1640: uint16(577), - 1641: uint16(451), - 1642: uint16(79), - 1643: uint16(79), - 1644: uint16(1028), - 1645: uint16(354), - 1646: uint16(356), - 1647: uint16(576), - 1648: uint16(360), + 1613: uint16(452), + 1614: uint16(577), + 1615: uint16(452), + 1616: uint16(576), + 1617: uint16(553), + 1618: uint16(1028), + 1619: uint16(142), + 1620: uint16(142), + 1621: uint16(169), + 1622: uint16(169), + 1623: uint16(576), + 1624: uint16(162), + 1625: uint16(162), + 1626: uint16(528), + 1627: uint16(889), + 1628: uint16(371), + 1629: uint16(452), + 1630: uint16(152), + 1631: uint16(152), + 1632: uint16(151), + 1633: uint16(151), + 1634: uint16(1379), + 1635: uint16(149), + 1636: uint16(149), + 1637: uint16(109), + 1638: uint16(370), + 1639: uint16(150), + 1640: uint16(150), + 1641: uint16(565), + 1642: uint16(576), + 1643: uint16(480), + 1644: uint16(576), + 1645: uint16(266), + 1646: uint16(86), + 1647: uint16(86), + 1648: uint16(576), 1649: uint16(1092), - 1650: uint16(110), - 1651: uint16(576), - 1652: uint16(974), - 1653: uint16(942), - 1654: uint16(264), - 1655: uint16(123), - 1656: uint16(457), - 1657: uint16(358), - 1658: uint16(239), - 1659: uint16(576), - 1660: uint16(519), - 1661: uint16(451), - 1662: uint16(939), - 1663: uint16(1104), - 1664: uint16(123), - 1665: uint16(1104), - 1666: uint16(173), - 1667: uint16(576), - 1668: uint16(1032), - 1669: uint16(43), - 1670: uint16(63), - 1671: uint16(63), - 1672: uint16(1324), - 1673: uint16(565), - 1674: uint16(168), - 1675: uint16(168), - 1676: uint16(1028), - 1677: uint16(1028), - 1678: uint16(1030), - 1679: uint16(1031), - 1680: uint16(35), - 1681: uint16(576), - 1682: uint16(169), - 1683: uint16(169), - 1684: uint16(1308), - 1685: uint16(872), - 1686: uint16(238), - 1687: uint16(157), - 1688: uint16(1589), - 1689: uint16(576), - 1690: uint16(86), - 1691: uint16(86), - 1692: uint16(365), - 1693: uint16(89), - 1694: uint16(568), - 1695: uint16(375), - 1696: uint16(4), - 1697: uint16(1103), - 1698: uint16(941), - 1699: uint16(1103), - 1700: uint16(123), - 1701: uint16(576), - 1702: uint16(1040), - 1703: uint16(1389), - 1704: uint16(64), - 1705: uint16(64), - 1706: uint16(1188), - 1707: uint16(1434), - 1708: uint16(119), - 1709: uint16(119), - 1710: uint16(571), - 1711: uint16(576), - 1712: uint16(82), - 1713: uint16(82), - 1714: uint16(563), - 1715: uint16(576), - 1716: uint16(120), - 1717: uint16(165), - 1718: uint16(451), - 1719: uint16(577), - 1720: uint16(451), - 1721: uint16(413), - 1722: uint16(1362), + 1650: uint16(1028), + 1651: uint16(1028), + 1652: uint16(1030), + 1653: uint16(1031), + 1654: uint16(35), + 1655: uint16(542), + 1656: uint16(482), + 1657: uint16(576), + 1658: uint16(266), + 1659: uint16(466), + 1660: uint16(543), + 1661: uint16(123), + 1662: uint16(568), + 1663: uint16(1616), + 1664: uint16(4), + 1665: uint16(88), + 1666: uint16(88), + 1667: uint16(85), + 1668: uint16(85), + 1669: uint16(475), + 1670: uint16(1040), + 1671: uint16(52), + 1672: uint16(52), + 1673: uint16(222), + 1674: uint16(901), + 1675: uint16(900), + 1676: uint16(121), + 1677: uint16(121), + 1678: uint16(571), + 1679: uint16(1188), + 1680: uint16(58), + 1681: uint16(58), + 1682: uint16(244), + 1683: uint16(1032), + 1684: uint16(122), + 1685: uint16(889), + 1686: uint16(452), + 1687: uint16(577), + 1688: uint16(452), + 1689: uint16(908), + 1690: uint16(909), + 1691: uint16(1028), + 1692: uint16(300), + 1693: uint16(347), + 1694: uint16(504), + 1695: uint16(111), + 1696: uint16(263), + 1697: uint16(361), + 1698: uint16(165), + 1699: uint16(111), + 1700: uint16(111), + 1701: uint16(1088), + 1702: uint16(452), + 1703: uint16(263), + 1704: uint16(974), + 1705: uint16(1153), + 1706: uint16(266), + 1707: uint16(1092), + 1708: uint16(986), + 1709: uint16(987), + 1710: uint16(942), + 1711: uint16(939), + 1712: uint16(125), + 1713: uint16(125), + 1714: uint16(565), + 1715: uint16(1103), + 1716: uint16(872), + 1717: uint16(1103), + 1718: uint16(159), + 1719: uint16(941), + 1720: uint16(1309), + 1721: uint16(125), + 1722: uint16(1557), 1723: uint16(1028), - 1724: uint16(144), - 1725: uint16(144), - 1726: uint16(319), - 1727: uint16(567), - 1728: uint16(576), - 1729: uint16(1374), - 1730: uint16(562), - 1731: uint16(498), - 1732: uint16(279), - 1733: uint16(451), - 1734: uint16(83), - 1735: uint16(83), - 1736: uint16(1439), - 1737: uint16(576), - 1738: uint16(166), - 1739: uint16(166), - 1740: uint16(576), - 1741: uint16(1289), - 1742: uint16(554), - 1743: uint16(576), - 1744: uint16(1280), - 1745: uint16(565), - 1746: uint16(576), - 1747: uint16(12), - 1748: uint16(576), - 1749: uint16(1268), - 1750: uint16(457), - 1751: uint16(146), - 1752: uint16(146), - 1753: uint16(1267), - 1754: uint16(576), - 1755: uint16(1028), - 1756: uint16(1028), - 1757: uint16(1030), - 1758: uint16(1031), - 1759: uint16(35), - 1760: uint16(140), - 1761: uint16(140), - 1762: uint16(1269), - 1763: uint16(167), - 1764: uint16(167), - 1765: uint16(1609), - 1766: uint16(160), - 1767: uint16(160), - 1768: uint16(1359), - 1769: uint16(150), - 1770: uint16(150), - 1771: uint16(149), - 1772: uint16(149), - 1773: uint16(311), - 1774: uint16(1040), - 1775: uint16(576), - 1776: uint16(312), - 1777: uint16(147), - 1778: uint16(147), - 1779: uint16(313), - 1780: uint16(119), - 1781: uint16(119), - 1782: uint16(222), - 1783: uint16(235), - 1784: uint16(576), - 1785: uint16(1188), - 1786: uint16(396), - 1787: uint16(576), - 1788: uint16(120), - 1789: uint16(576), - 1790: uint16(451), - 1791: uint16(577), - 1792: uint16(451), - 1793: uint16(1192), - 1794: uint16(453), - 1795: uint16(1028), - 1796: uint16(508), - 1797: uint16(291), - 1798: uint16(148), - 1799: uint16(148), - 1800: uint16(1421), - 1801: uint16(1612), - 1802: uint16(395), - 1803: uint16(395), - 1804: uint16(394), - 1805: uint16(276), - 1806: uint16(392), - 1807: uint16(85), - 1808: uint16(85), - 1809: uint16(859), - 1810: uint16(87), - 1811: uint16(87), - 1812: uint16(84), - 1813: uint16(84), - 1814: uint16(553), - 1815: uint16(576), - 1816: uint16(294), - 1817: uint16(576), - 1818: uint16(1426), - 1819: uint16(338), - 1820: uint16(339), - 1821: uint16(1425), - 1822: uint16(237), - 1823: uint16(300), - 1824: uint16(326), - 1825: uint16(1416), - 1826: uint16(1409), - 1827: uint16(1028), - 1828: uint16(1028), - 1829: uint16(1030), - 1830: uint16(1031), - 1831: uint16(35), - 1832: uint16(325), - 1833: uint16(344), - 1834: uint16(403), - 1835: uint16(483), - 1836: uint16(226), - 1837: uint16(1307), - 1838: uint16(52), - 1839: uint16(52), - 1840: uint16(58), - 1841: uint16(58), - 1842: uint16(368), - 1843: uint16(1371), - 1844: uint16(1502), - 1845: uint16(566), - 1846: uint16(1501), - 1847: uint16(121), - 1848: uint16(568), - 1849: uint16(221), - 1850: uint16(4), - 1851: uint16(208), - 1852: uint16(268), - 1853: uint16(209), - 1854: uint16(390), - 1855: uint16(1244), - 1856: uint16(1549), - 1857: uint16(1188), - 1858: uint16(1372), - 1859: uint16(1370), - 1860: uint16(1369), - 1861: uint16(1547), - 1862: uint16(239), - 1863: uint16(184), - 1864: uint16(571), - 1865: uint16(233), - 1866: uint16(421), - 1867: uint16(1241), - 1868: uint16(95), - 1869: uint16(218), - 1870: uint16(173), + 1724: uint16(1028), + 1725: uint16(1030), + 1726: uint16(1031), + 1727: uint16(35), + 1728: uint16(542), + 1729: uint16(337), + 1730: uint16(1530), + 1731: uint16(205), + 1732: uint16(1529), + 1733: uint16(541), + 1734: uint16(499), + 1735: uint16(1589), + 1736: uint16(490), + 1737: uint16(348), + 1738: uint16(1376), + 1739: uint16(352), + 1740: uint16(355), + 1741: uint16(1032), + 1742: uint16(357), + 1743: uint16(1040), + 1744: uint16(359), + 1745: uint16(1324), + 1746: uint16(1308), + 1747: uint16(366), + 1748: uint16(563), + 1749: uint16(121), + 1750: uint16(121), + 1751: uint16(376), + 1752: uint16(1188), + 1753: uint16(1389), + 1754: uint16(1434), + 1755: uint16(1362), + 1756: uint16(280), + 1757: uint16(122), + 1758: uint16(1374), + 1759: uint16(452), + 1760: uint16(577), + 1761: uint16(452), + 1762: uint16(167), + 1763: uint16(1439), + 1764: uint16(1028), + 1765: uint16(1289), + 1766: uint16(1280), + 1767: uint16(1268), + 1768: uint16(1267), + 1769: uint16(1269), + 1770: uint16(1609), + 1771: uint16(1359), + 1772: uint16(312), + 1773: uint16(313), + 1774: uint16(314), + 1775: uint16(397), + 1776: uint16(12), + 1777: uint16(237), + 1778: uint16(224), + 1779: uint16(1421), + 1780: uint16(295), + 1781: uint16(1416), + 1782: uint16(1409), + 1783: uint16(1426), + 1784: uint16(339), + 1785: uint16(484), + 1786: uint16(340), + 1787: uint16(509), + 1788: uint16(1371), + 1789: uint16(1612), + 1790: uint16(1372), + 1791: uint16(1425), + 1792: uint16(1244), + 1793: uint16(404), + 1794: uint16(301), + 1795: uint16(228), + 1796: uint16(1028), + 1797: uint16(1028), + 1798: uint16(1030), + 1799: uint16(1031), + 1800: uint16(35), + 1801: uint16(1601), + 1802: uint16(1192), + 1803: uint16(454), + 1804: uint16(345), + 1805: uint16(1307), + 1806: uint16(292), + 1807: uint16(369), + 1808: uint16(1502), + 1809: uint16(1501), + 1810: uint16(270), + 1811: uint16(396), + 1812: uint16(396), + 1813: uint16(395), + 1814: uint16(277), + 1815: uint16(393), + 1816: uint16(1370), + 1817: uint16(1369), + 1818: uint16(859), + 1819: uint16(1549), + 1820: uint16(186), + 1821: uint16(123), + 1822: uint16(568), + 1823: uint16(235), + 1824: uint16(4), + 1825: uint16(1188), + 1826: uint16(391), + 1827: uint16(210), + 1828: uint16(211), + 1829: uint16(223), + 1830: uint16(1547), + 1831: uint16(239), + 1832: uint16(1241), + 1833: uint16(327), + 1834: uint16(422), + 1835: uint16(96), + 1836: uint16(220), + 1837: uint16(195), + 1838: uint16(571), + 1839: uint16(180), + 1840: uint16(188), + 1841: uint16(326), + 1842: uint16(468), + 1843: uint16(469), + 1844: uint16(190), + 1845: uint16(191), + 1846: uint16(502), + 1847: uint16(192), + 1848: uint16(193), + 1849: uint16(566), + 1850: uint16(247), + 1851: uint16(109), + 1852: uint16(1430), + 1853: uint16(491), + 1854: uint16(199), + 1855: uint16(251), + 1856: uint16(102), + 1857: uint16(281), + 1858: uint16(402), + 1859: uint16(476), + 1860: uint16(405), + 1861: uint16(1496), + 1862: uint16(452), + 1863: uint16(497), + 1864: uint16(253), + 1865: uint16(1422), + 1866: uint16(13), + 1867: uint16(1428), + 1868: uint16(14), + 1869: uint16(1427), + 1870: uint16(203), 1871: uint16(1507), - 1872: uint16(193), - 1873: uint16(43), - 1874: uint16(91), - 1875: uint16(94), - 1876: uint16(178), - 1877: uint16(186), - 1878: uint16(467), - 1879: uint16(188), - 1880: uint16(468), - 1881: uint16(1422), - 1882: uint16(13), - 1883: uint16(189), - 1884: uint16(190), - 1885: uint16(191), - 1886: uint16(501), - 1887: uint16(451), - 1888: uint16(245), - 1889: uint16(108), - 1890: uint16(238), - 1891: uint16(401), - 1892: uint16(1428), - 1893: uint16(1427), - 1894: uint16(1430), - 1895: uint16(475), - 1896: uint16(404), - 1897: uint16(1496), - 1898: uint16(197), - 1899: uint16(565), - 1900: uint16(14), - 1901: uint16(490), - 1902: uint16(249), - 1903: uint16(101), - 1904: uint16(1518), - 1905: uint16(496), - 1906: uint16(349), - 1907: uint16(280), - 1908: uint16(251), - 1909: uint16(201), - 1910: uint16(353), - 1911: uint16(499), - 1912: uint16(252), - 1913: uint16(406), - 1914: uint16(1270), - 1915: uint16(253), - 1916: uint16(517), - 1917: uint16(1327), - 1918: uint16(1326), - 1919: uint16(435), - 1920: uint16(1325), - 1921: uint16(1318), - 1922: uint16(103), - 1923: uint16(893), - 1924: uint16(1296), - 1925: uint16(413), - 1926: uint16(227), - 1927: uint16(407), - 1928: uint16(1040), - 1929: uint16(1626), - 1930: uint16(319), - 1931: uint16(567), - 1932: uint16(1625), - 1933: uint16(1297), - 1934: uint16(119), - 1935: uint16(119), - 1936: uint16(439), - 1937: uint16(367), - 1938: uint16(1317), - 1939: uint16(1295), - 1940: uint16(1624), - 1941: uint16(526), - 1942: uint16(120), - 1943: uint16(440), - 1944: uint16(451), - 1945: uint16(577), - 1946: uint16(451), - 1947: uint16(1594), - 1948: uint16(309), - 1949: uint16(1028), - 1950: uint16(310), - 1951: uint16(373), - 1952: uint16(266), - 1953: uint16(267), - 1954: uint16(457), - 1955: uint16(1580), - 1956: uint16(1579), - 1957: uint16(443), - 1958: uint16(138), - 1959: uint16(1394), - 1960: uint16(552), - 1961: uint16(1393), - 1962: uint16(11), - 1963: uint16(1483), - 1964: uint16(384), - 1965: uint16(115), - 1966: uint16(317), - 1967: uint16(1350), - 1968: uint16(109), - 1969: uint16(536), - 1970: uint16(42), - 1971: uint16(579), - 1972: uint16(382), - 1973: uint16(214), - 1974: uint16(1349), - 1975: uint16(388), - 1976: uint16(1198), - 1977: uint16(389), - 1978: uint16(275), - 1979: uint16(277), - 1980: uint16(278), - 1981: uint16(1028), - 1982: uint16(1028), - 1983: uint16(1030), - 1984: uint16(1031), - 1985: uint16(35), - 1986: uint16(580), - 1987: uint16(1265), - 1988: uint16(414), - 1989: uint16(1260), - 1990: uint16(170), - 1991: uint16(415), - 1992: uint16(183), - 1993: uint16(1534), - 1994: uint16(1535), - 1995: uint16(1533), - 1996: uint16(171), - 1997: uint16(154), - 1998: uint16(307), - 1999: uint16(1532), - 2000: uint16(846), - 2001: uint16(223), - 2002: uint16(224), - 2003: uint16(88), - 2004: uint16(452), - 2005: uint16(215), - 2006: uint16(172), - 2007: uint16(321), - 2008: uint16(234), - 2009: uint16(1102), - 2010: uint16(152), - 2011: uint16(1188), - 2012: uint16(1100), - 2013: uint16(329), - 2014: uint16(185), - 2015: uint16(174), - 2016: uint16(1223), - 2017: uint16(925), - 2018: uint16(187), - 2019: uint16(241), - 2020: uint16(337), - 2021: uint16(244), - 2022: uint16(1116), - 2023: uint16(192), - 2024: uint16(175), - 2025: uint16(176), - 2026: uint16(424), - 2027: uint16(426), - 2028: uint16(97), - 2029: uint16(194), - 2030: uint16(98), - 2031: uint16(99), - 2032: uint16(100), - 2033: uint16(177), - 2034: uint16(1119), - 2035: uint16(1115), - 2036: uint16(246), - 2037: uint16(247), - 2038: uint16(161), - 2039: uint16(24), - 2040: uint16(248), - 2041: uint16(348), - 2042: uint16(1238), - 2043: uint16(264), - 2044: uint16(1108), - 2045: uint16(250), - 2046: uint16(495), - 2047: uint16(199), - 2048: uint16(198), - 2049: uint16(15), - 2050: uint16(861), - 2051: uint16(500), - 2052: uint16(369), - 2053: uint16(254), - 2054: uint16(504), - 2055: uint16(509), - 2056: uint16(512), - 2057: uint16(200), - 2058: uint16(102), - 2059: uint16(25), - 2060: uint16(179), - 2061: uint16(361), - 2062: uint16(26), - 2063: uint16(364), - 2064: uint16(104), - 2065: uint16(891), - 2066: uint16(308), - 2067: uint16(162), - 2068: uint16(105), - 2069: uint16(904), - 2070: uint16(520), - 2071: uint16(106), - 2072: uint16(1185), - 2073: uint16(1069), - 2074: uint16(1155), - 2075: uint16(17), - 2076: uint16(228), - 2077: uint16(27), - 2078: uint16(1154), - 2079: uint16(283), - 2080: uint16(285), - 2081: uint16(263), - 2082: uint16(978), - 2083: uint16(202), - 2084: uint16(972), - 2085: uint16(123), - 2086: uint16(28), - 2087: uint16(1175), - 2088: uint16(29), - 2089: uint16(30), - 2090: uint16(1179), - 2091: uint16(1171), - 2092: uint16(31), - 2093: uint16(1173), - 2094: uint16(1160), - 2095: uint16(41), - 2096: uint16(32), - 2097: uint16(206), - 2098: uint16(548), - 2099: uint16(33), - 2100: uint16(110), - 2101: uint16(1178), - 2102: uint16(1083), - 2103: uint16(8), - 2104: uint16(112), - 2105: uint16(1070), - 2106: uint16(113), - 2107: uint16(1068), - 2108: uint16(1072), - 2109: uint16(34), - 2110: uint16(1073), - 2111: uint16(560), - 2112: uint16(1125), - 2113: uint16(269), - 2114: uint16(1124), - 2115: uint16(270), - 2116: uint16(36), - 2117: uint16(18), - 2118: uint16(1194), - 2119: uint16(1033), - 2120: uint16(873), - 2121: uint16(151), - 2122: uint16(122), - 2123: uint16(37), - 2124: uint16(393), - 2125: uint16(271), - 2126: uint16(272), - 2127: uint16(572), - 2128: uint16(181), - 2129: uint16(1193), - 2130: uint16(1256), - 2131: uint16(1256), - 2132: uint16(1256), - 2133: uint16(935), - 2134: uint16(1256), - 2135: uint16(1256), - 2136: uint16(1256), - 2137: uint16(1256), - 2138: uint16(1256), - 2139: uint16(1256), - 2140: uint16(1256), - 2141: uint16(1617), -} -var _yy_lookahead = [2328]uint16{ - 0: uint16(194), - 1: uint16(276), - 2: uint16(277), - 3: uint16(278), - 4: uint16(216), - 5: uint16(194), - 6: uint16(194), - 7: uint16(217), - 8: uint16(194), - 9: uint16(194), - 10: uint16(194), - 11: uint16(194), - 12: uint16(224), - 13: uint16(194), - 14: uint16(194), - 15: uint16(276), - 16: uint16(277), - 17: uint16(278), - 18: uint16(204), + 1872: uint16(241), + 1873: uint16(500), + 1874: uint16(565), + 1875: uint16(354), + 1876: uint16(407), + 1877: uint16(92), + 1878: uint16(95), + 1879: uint16(1270), + 1880: uint16(175), + 1881: uint16(254), + 1882: uint16(518), + 1883: uint16(43), + 1884: uint16(1327), + 1885: uint16(255), + 1886: uint16(1326), + 1887: uint16(1325), + 1888: uint16(436), + 1889: uint16(1518), + 1890: uint16(350), + 1891: uint16(1318), + 1892: uint16(104), + 1893: uint16(229), + 1894: uint16(893), + 1895: uint16(1626), + 1896: uint16(440), + 1897: uint16(441), + 1898: uint16(1625), + 1899: uint16(408), + 1900: uint16(240), + 1901: uint16(1296), + 1902: uint16(268), + 1903: uint16(1040), + 1904: uint16(310), + 1905: uint16(269), + 1906: uint16(1297), + 1907: uint16(527), + 1908: uint16(444), + 1909: uint16(121), + 1910: uint16(121), + 1911: uint16(368), + 1912: uint16(1295), + 1913: uint16(1594), + 1914: uint16(1624), + 1915: uint16(311), + 1916: uint16(1394), + 1917: uint16(122), + 1918: uint16(1317), + 1919: uint16(452), + 1920: uint16(577), + 1921: uint16(452), + 1922: uint16(374), + 1923: uint16(1580), + 1924: uint16(1028), + 1925: uint16(1393), + 1926: uint16(140), + 1927: uint16(553), + 1928: uint16(11), + 1929: uint16(90), + 1930: uint16(568), + 1931: uint16(385), + 1932: uint16(4), + 1933: uint16(116), + 1934: uint16(318), + 1935: uint16(414), + 1936: uint16(1579), + 1937: uint16(110), + 1938: uint16(1483), + 1939: uint16(537), + 1940: uint16(320), + 1941: uint16(567), + 1942: uint16(1350), + 1943: uint16(555), + 1944: uint16(42), + 1945: uint16(579), + 1946: uint16(571), + 1947: uint16(1349), + 1948: uint16(1198), + 1949: uint16(383), + 1950: uint16(276), + 1951: uint16(390), + 1952: uint16(216), + 1953: uint16(389), + 1954: uint16(278), + 1955: uint16(279), + 1956: uint16(1028), + 1957: uint16(1028), + 1958: uint16(1030), + 1959: uint16(1031), + 1960: uint16(35), + 1961: uint16(172), + 1962: uint16(580), + 1963: uint16(1265), + 1964: uint16(458), + 1965: uint16(1260), + 1966: uint16(415), + 1967: uint16(416), + 1968: uint16(185), + 1969: uint16(156), + 1970: uint16(452), + 1971: uint16(1534), + 1972: uint16(1535), + 1973: uint16(173), + 1974: uint16(1533), + 1975: uint16(1532), + 1976: uint16(89), + 1977: uint16(308), + 1978: uint16(225), + 1979: uint16(226), + 1980: uint16(846), + 1981: uint16(174), + 1982: uint16(565), + 1983: uint16(453), + 1984: uint16(217), + 1985: uint16(1188), + 1986: uint16(322), + 1987: uint16(236), + 1988: uint16(1102), + 1989: uint16(154), + 1990: uint16(1100), + 1991: uint16(330), + 1992: uint16(187), + 1993: uint16(176), + 1994: uint16(1223), + 1995: uint16(243), + 1996: uint16(189), + 1997: uint16(925), + 1998: uint16(338), + 1999: uint16(246), + 2000: uint16(1116), + 2001: uint16(194), + 2002: uint16(177), + 2003: uint16(425), + 2004: uint16(178), + 2005: uint16(427), + 2006: uint16(98), + 2007: uint16(196), + 2008: uint16(99), + 2009: uint16(100), + 2010: uint16(101), + 2011: uint16(1040), + 2012: uint16(179), + 2013: uint16(1119), + 2014: uint16(1115), + 2015: uint16(248), + 2016: uint16(249), + 2017: uint16(121), + 2018: uint16(121), + 2019: uint16(163), + 2020: uint16(24), + 2021: uint16(250), + 2022: uint16(349), + 2023: uint16(1238), + 2024: uint16(496), + 2025: uint16(122), + 2026: uint16(1108), + 2027: uint16(452), + 2028: uint16(577), + 2029: uint16(452), + 2030: uint16(1192), + 2031: uint16(454), + 2032: uint16(1028), + 2033: uint16(266), + 2034: uint16(292), + 2035: uint16(200), + 2036: uint16(252), + 2037: uint16(201), + 2038: uint16(861), + 2039: uint16(396), + 2040: uint16(396), + 2041: uint16(395), + 2042: uint16(277), + 2043: uint16(393), + 2044: uint16(15), + 2045: uint16(501), + 2046: uint16(859), + 2047: uint16(370), + 2048: uint16(292), + 2049: uint16(256), + 2050: uint16(202), + 2051: uint16(554), + 2052: uint16(505), + 2053: uint16(396), + 2054: uint16(396), + 2055: uint16(395), + 2056: uint16(277), + 2057: uint16(393), + 2058: uint16(103), + 2059: uint16(239), + 2060: uint16(859), + 2061: uint16(327), + 2062: uint16(25), + 2063: uint16(26), + 2064: uint16(1028), + 2065: uint16(1028), + 2066: uint16(1030), + 2067: uint16(1031), + 2068: uint16(35), + 2069: uint16(326), + 2070: uint16(362), + 2071: uint16(510), + 2072: uint16(891), + 2073: uint16(239), + 2074: uint16(365), + 2075: uint16(327), + 2076: uint16(513), + 2077: uint16(904), + 2078: uint16(105), + 2079: uint16(309), + 2080: uint16(164), + 2081: uint16(181), + 2082: uint16(27), + 2083: uint16(326), + 2084: uint16(106), + 2085: uint16(521), + 2086: uint16(107), + 2087: uint16(1185), + 2088: uint16(1069), + 2089: uint16(1155), + 2090: uint16(17), + 2091: uint16(1154), + 2092: uint16(230), + 2093: uint16(1188), + 2094: uint16(284), + 2095: uint16(286), + 2096: uint16(265), + 2097: uint16(204), + 2098: uint16(125), + 2099: uint16(1171), + 2100: uint16(241), + 2101: uint16(28), + 2102: uint16(978), + 2103: uint16(972), + 2104: uint16(29), + 2105: uint16(41), + 2106: uint16(1175), + 2107: uint16(1179), + 2108: uint16(175), + 2109: uint16(1173), + 2110: uint16(30), + 2111: uint16(43), + 2112: uint16(31), + 2113: uint16(8), + 2114: uint16(241), + 2115: uint16(1178), + 2116: uint16(32), + 2117: uint16(1160), + 2118: uint16(208), + 2119: uint16(549), + 2120: uint16(33), + 2121: uint16(111), + 2122: uint16(175), + 2123: uint16(1083), + 2124: uint16(1070), + 2125: uint16(43), + 2126: uint16(1068), + 2127: uint16(1072), + 2128: uint16(240), + 2129: uint16(113), + 2130: uint16(114), + 2131: uint16(34), + 2132: uint16(561), + 2133: uint16(118), + 2134: uint16(1124), + 2135: uint16(271), + 2136: uint16(1073), + 2137: uint16(36), + 2138: uint16(18), + 2139: uint16(572), + 2140: uint16(1033), + 2141: uint16(873), + 2142: uint16(240), + 2143: uint16(124), + 2144: uint16(37), + 2145: uint16(935), + 2146: uint16(272), + 2147: uint16(273), + 2148: uint16(1617), + 2149: uint16(183), + 2150: uint16(153), + 2151: uint16(394), + 2152: uint16(1194), + 2153: uint16(1193), + 2154: uint16(1256), + 2155: uint16(1256), + 2156: uint16(1256), + 2157: uint16(1256), + 2158: uint16(1256), + 2159: uint16(1256), + 2160: uint16(1256), + 2161: uint16(1256), + 2162: uint16(1256), + 2163: uint16(414), + 2164: uint16(1256), + 2165: uint16(1256), + 2166: uint16(1256), + 2167: uint16(1256), + 2168: uint16(320), + 2169: uint16(567), + 2170: uint16(1256), + 2171: uint16(1256), + 2172: uint16(1256), + 2173: uint16(1256), + 2174: uint16(1256), + 2175: uint16(1256), + 2176: uint16(1256), + 2177: uint16(414), + 2178: uint16(1256), + 2179: uint16(1256), + 2180: uint16(1256), + 2181: uint16(1256), + 2182: uint16(320), + 2183: uint16(567), + 2184: uint16(1256), + 2185: uint16(1256), + 2186: uint16(1256), + 2187: uint16(1256), + 2188: uint16(1256), + 2189: uint16(1256), + 2190: uint16(1256), + 2191: uint16(1256), + 2192: uint16(458), + 2193: uint16(1256), + 2194: uint16(1256), + 2195: uint16(1256), + 2196: uint16(1256), + 2197: uint16(1256), + 2198: uint16(1256), + 2199: uint16(1256), + 2200: uint16(1256), + 2201: uint16(1256), + 2202: uint16(1256), + 2203: uint16(1256), + 2204: uint16(1256), + 2205: uint16(1256), + 2206: uint16(458), +} +var _yy_lookahead = [2394]uint16{ + 0: uint16(277), + 1: uint16(278), + 2: uint16(279), + 3: uint16(241), + 4: uint16(242), + 5: uint16(225), + 6: uint16(195), + 7: uint16(227), + 8: uint16(195), + 9: uint16(241), + 10: uint16(242), + 11: uint16(195), + 12: uint16(217), + 13: uint16(221), + 14: uint16(195), + 15: uint16(235), + 16: uint16(254), + 17: uint16(195), + 18: uint16(256), 19: uint16(19), - 20: uint16(206), - 21: uint16(202), - 22: uint16(297), - 23: uint16(217), - 24: uint16(218), - 25: uint16(205), - 26: uint16(207), - 27: uint16(217), - 28: uint16(205), - 29: uint16(217), - 30: uint16(218), + 20: uint16(225), + 21: uint16(298), + 22: uint16(254), + 23: uint16(195), + 24: uint16(256), + 25: uint16(206), + 26: uint16(213), + 27: uint16(214), + 28: uint16(206), + 29: uint16(218), + 30: uint16(219), 31: uint16(31), - 32: uint16(217), - 33: uint16(218), - 34: uint16(217), - 35: uint16(218), - 36: uint16(29), - 37: uint16(217), - 38: uint16(218), + 32: uint16(206), + 33: uint16(195), + 34: uint16(218), + 35: uint16(219), + 36: uint16(195), + 37: uint16(218), + 38: uint16(219), 39: uint16(39), - 40: uint16(33), - 41: uint16(217), - 42: uint16(220), + 40: uint16(218), + 41: uint16(219), + 42: uint16(313), 43: uint16(43), 44: uint16(44), 45: uint16(45), - 46: uint16(46), + 46: uint16(317), 47: uint16(47), 48: uint16(48), 49: uint16(49), @@ -150004,35 +152208,35 @@ var _yy_lookahead = [2328]uint16{ 55: uint16(55), 56: uint16(56), 57: uint16(57), - 58: uint16(312), + 58: uint16(58), 59: uint16(19), - 60: uint16(240), - 61: uint16(241), - 62: uint16(316), - 63: uint16(240), - 64: uint16(241), - 65: uint16(194), - 66: uint16(46), - 67: uint16(47), - 68: uint16(48), - 69: uint16(49), - 70: uint16(22), - 71: uint16(254), - 72: uint16(65), - 73: uint16(253), - 74: uint16(254), - 75: uint16(255), - 76: uint16(253), - 77: uint16(194), - 78: uint16(255), - 79: uint16(194), - 80: uint16(263), - 81: uint16(258), - 82: uint16(259), + 60: uint16(241), + 61: uint16(242), + 62: uint16(195), + 63: uint16(241), + 64: uint16(242), + 65: uint16(195), + 66: uint16(255), + 67: uint16(241), + 68: uint16(242), + 69: uint16(277), + 70: uint16(278), + 71: uint16(279), + 72: uint16(234), + 73: uint16(254), + 74: uint16(255), + 75: uint16(256), + 76: uint16(254), + 77: uint16(255), + 78: uint16(256), + 79: uint16(218), + 80: uint16(254), + 81: uint16(240), + 82: uint16(256), 83: uint16(43), 84: uint16(44), 85: uint16(45), - 86: uint16(46), + 86: uint16(264), 87: uint16(47), 88: uint16(48), 89: uint16(49), @@ -150044,11 +152248,11 @@ var _yy_lookahead = [2328]uint16{ 95: uint16(55), 96: uint16(56), 97: uint16(57), - 98: uint16(276), - 99: uint16(277), - 100: uint16(278), - 101: uint16(285), - 102: uint16(102), + 98: uint16(58), + 99: uint16(271), + 100: uint16(287), + 101: uint16(22), + 102: uint16(23), 103: uint16(103), 104: uint16(104), 105: uint16(105), @@ -150060,35 +152264,35 @@ var _yy_lookahead = [2328]uint16{ 111: uint16(111), 112: uint16(112), 113: uint16(113), - 114: uint16(59), - 115: uint16(186), - 116: uint16(187), - 117: uint16(188), - 118: uint16(189), - 119: uint16(190), - 120: uint16(191), - 121: uint16(310), - 122: uint16(239), - 123: uint16(317), - 124: uint16(318), - 125: uint16(196), - 126: uint16(86), - 127: uint16(198), - 128: uint16(88), - 129: uint16(317), - 130: uint16(19), - 131: uint16(319), - 132: uint16(317), - 133: uint16(318), - 134: uint16(205), - 135: uint16(264), - 136: uint16(25), - 137: uint16(211), - 138: uint16(212), - 139: uint16(213), - 140: uint16(205), - 141: uint16(121), - 142: uint16(102), + 114: uint16(114), + 115: uint16(114), + 116: uint16(47), + 117: uint16(48), + 118: uint16(49), + 119: uint16(50), + 120: uint16(187), + 121: uint16(188), + 122: uint16(189), + 123: uint16(190), + 124: uint16(191), + 125: uint16(192), + 126: uint16(190), + 127: uint16(87), + 128: uint16(192), + 129: uint16(89), + 130: uint16(197), + 131: uint16(19), + 132: uint16(199), + 133: uint16(197), + 134: uint16(318), + 135: uint16(199), + 136: uint16(320), + 137: uint16(25), + 138: uint16(195), + 139: uint16(206), + 140: uint16(299), + 141: uint16(271), + 142: uint16(206), 143: uint16(103), 144: uint16(104), 145: uint16(105), @@ -150100,3176 +152304,3243 @@ var _yy_lookahead = [2328]uint16{ 151: uint16(111), 152: uint16(112), 153: uint16(113), - 154: uint16(43), - 155: uint16(44), - 156: uint16(45), - 157: uint16(46), - 158: uint16(47), - 159: uint16(48), - 160: uint16(49), - 161: uint16(50), - 162: uint16(51), - 163: uint16(52), - 164: uint16(53), - 165: uint16(54), - 166: uint16(55), - 167: uint16(56), - 168: uint16(57), - 169: uint16(240), - 170: uint16(241), - 171: uint16(116), - 172: uint16(117), - 173: uint16(118), - 174: uint16(119), - 175: uint16(240), - 176: uint16(241), - 177: uint16(122), - 178: uint16(123), - 179: uint16(124), - 180: uint16(69), - 181: uint16(298), - 182: uint16(253), - 183: uint16(194), - 184: uint16(255), - 185: uint16(106), - 186: uint16(107), - 187: uint16(132), - 188: uint16(253), - 189: uint16(141), - 190: uint16(255), - 191: uint16(54), - 192: uint16(55), - 193: uint16(56), - 194: uint16(57), - 195: uint16(58), - 196: uint16(207), - 197: uint16(268), - 198: uint16(102), - 199: uint16(103), - 200: uint16(104), - 201: uint16(105), - 202: uint16(106), - 203: uint16(107), - 204: uint16(108), - 205: uint16(109), - 206: uint16(110), - 207: uint16(111), - 208: uint16(112), - 209: uint16(113), - 210: uint16(214), - 211: uint16(128), - 212: uint16(129), - 213: uint16(102), - 214: uint16(103), - 215: uint16(104), - 216: uint16(105), - 217: uint16(106), - 218: uint16(107), - 219: uint16(108), - 220: uint16(109), - 221: uint16(110), - 222: uint16(111), - 223: uint16(112), - 224: uint16(113), - 225: uint16(134), - 226: uint16(25), - 227: uint16(136), - 228: uint16(137), - 229: uint16(300), - 230: uint16(165), - 231: uint16(166), - 232: uint16(153), - 233: uint16(19), - 234: uint16(155), - 235: uint16(54), - 236: uint16(55), - 237: uint16(56), - 238: uint16(57), - 239: uint16(102), - 240: uint16(103), - 241: uint16(104), - 242: uint16(105), - 243: uint16(106), - 244: uint16(107), - 245: uint16(108), - 246: uint16(109), - 247: uint16(110), - 248: uint16(111), - 249: uint16(112), - 250: uint16(113), - 251: uint16(108), - 252: uint16(109), - 253: uint16(110), - 254: uint16(111), - 255: uint16(112), - 256: uint16(113), - 257: uint16(43), - 258: uint16(44), - 259: uint16(45), - 260: uint16(46), - 261: uint16(47), - 262: uint16(48), - 263: uint16(49), - 264: uint16(50), - 265: uint16(51), - 266: uint16(52), - 267: uint16(53), - 268: uint16(54), - 269: uint16(55), - 270: uint16(56), - 271: uint16(57), - 272: uint16(276), - 273: uint16(277), - 274: uint16(278), - 275: uint16(113), - 276: uint16(194), - 277: uint16(19), - 278: uint16(22), - 279: uint16(23), - 280: uint16(194), - 281: uint16(67), - 282: uint16(24), - 283: uint16(102), - 284: uint16(103), - 285: uint16(104), - 286: uint16(105), - 287: uint16(106), - 288: uint16(107), - 289: uint16(108), - 290: uint16(109), - 291: uint16(110), - 292: uint16(111), - 293: uint16(112), - 294: uint16(113), - 295: uint16(220), - 296: uint16(250), - 297: uint16(59), - 298: uint16(252), - 299: uint16(217), - 300: uint16(218), - 301: uint16(43), - 302: uint16(44), - 303: uint16(45), - 304: uint16(46), - 305: uint16(47), - 306: uint16(48), - 307: uint16(49), - 308: uint16(50), - 309: uint16(51), - 310: uint16(52), - 311: uint16(53), - 312: uint16(54), - 313: uint16(55), - 314: uint16(56), - 315: uint16(57), - 316: uint16(102), - 317: uint16(103), - 318: uint16(104), - 319: uint16(105), - 320: uint16(106), - 321: uint16(107), - 322: uint16(108), - 323: uint16(109), - 324: uint16(110), - 325: uint16(111), - 326: uint16(112), - 327: uint16(113), - 328: uint16(106), - 329: uint16(107), - 330: uint16(108), - 331: uint16(109), - 332: uint16(110), - 333: uint16(111), - 334: uint16(112), - 335: uint16(113), - 336: uint16(254), - 337: uint16(59), - 338: uint16(205), - 339: uint16(138), - 340: uint16(139), - 341: uint16(19), - 342: uint16(20), - 343: uint16(194), - 344: uint16(22), - 345: uint16(263), - 346: uint16(22), - 347: uint16(23), - 348: uint16(231), - 349: uint16(25), - 350: uint16(72), - 351: uint16(276), - 352: uint16(277), - 353: uint16(278), - 354: uint16(116), - 355: uint16(117), - 356: uint16(118), - 357: uint16(101), - 358: uint16(36), - 359: uint16(76), - 360: uint16(102), - 361: uint16(103), - 362: uint16(104), - 363: uint16(105), - 364: uint16(106), - 365: uint16(107), - 366: uint16(108), - 367: uint16(109), - 368: uint16(110), - 369: uint16(111), - 370: uint16(112), - 371: uint16(113), - 372: uint16(89), - 373: uint16(240), - 374: uint16(241), - 375: uint16(92), - 376: uint16(73), - 377: uint16(194), - 378: uint16(194), - 379: uint16(73), - 380: uint16(19), - 381: uint16(59), - 382: uint16(188), - 383: uint16(189), - 384: uint16(190), - 385: uint16(191), - 386: uint16(253), - 387: uint16(81), - 388: uint16(255), - 389: uint16(151), - 390: uint16(196), - 391: uint16(25), - 392: uint16(198), - 393: uint16(71), - 394: uint16(116), - 395: uint16(117), - 396: uint16(118), - 397: uint16(311), - 398: uint16(312), - 399: uint16(205), - 400: uint16(217), - 401: uint16(218), - 402: uint16(316), - 403: uint16(81), - 404: uint16(43), - 405: uint16(44), - 406: uint16(45), - 407: uint16(46), - 408: uint16(47), - 409: uint16(48), - 410: uint16(49), - 411: uint16(50), - 412: uint16(51), - 413: uint16(52), - 414: uint16(53), - 415: uint16(54), - 416: uint16(55), - 417: uint16(56), - 418: uint16(57), - 419: uint16(270), - 420: uint16(22), - 421: uint16(23), - 422: uint16(100), - 423: uint16(25), - 424: uint16(59), - 425: uint16(101), - 426: uint16(138), - 427: uint16(139), - 428: uint16(106), - 429: uint16(107), - 430: uint16(127), - 431: uint16(128), - 432: uint16(129), - 433: uint16(127), - 434: uint16(240), - 435: uint16(241), - 436: uint16(114), - 437: uint16(254), - 438: uint16(116), - 439: uint16(117), - 440: uint16(118), - 441: uint16(76), - 442: uint16(76), - 443: uint16(121), - 444: uint16(138), - 445: uint16(139), - 446: uint16(263), - 447: uint16(253), - 448: uint16(264), - 449: uint16(255), - 450: uint16(205), - 451: uint16(275), - 452: uint16(87), - 453: uint16(19), - 454: uint16(89), - 455: uint16(89), - 456: uint16(194), - 457: uint16(92), - 458: uint16(92), - 459: uint16(199), - 460: uint16(138), - 461: uint16(139), - 462: uint16(268), - 463: uint16(102), - 464: uint16(103), - 465: uint16(104), - 466: uint16(105), - 467: uint16(106), - 468: uint16(107), - 469: uint16(108), - 470: uint16(109), - 471: uint16(110), - 472: uint16(111), - 473: uint16(112), - 474: uint16(113), - 475: uint16(153), - 476: uint16(154), - 477: uint16(155), - 478: uint16(156), - 479: uint16(157), - 480: uint16(81), - 481: uint16(116), - 482: uint16(117), - 483: uint16(118), - 484: uint16(129), - 485: uint16(240), - 486: uint16(241), - 487: uint16(224), - 488: uint16(19), - 489: uint16(226), - 490: uint16(314), - 491: uint16(315), - 492: uint16(23), - 493: uint16(25), - 494: uint16(300), - 495: uint16(59), - 496: uint16(22), - 497: uint16(234), - 498: uint16(253), - 499: uint16(101), - 500: uint16(255), - 501: uint16(236), - 502: uint16(237), - 503: uint16(26), - 504: uint16(194), - 505: uint16(183), - 506: uint16(194), - 507: uint16(152), - 508: uint16(72), - 509: uint16(22), - 510: uint16(145), - 511: uint16(150), - 512: uint16(43), - 513: uint16(44), - 514: uint16(45), - 515: uint16(46), - 516: uint16(47), - 517: uint16(48), - 518: uint16(49), - 519: uint16(50), - 520: uint16(51), - 521: uint16(52), - 522: uint16(53), - 523: uint16(54), - 524: uint16(55), - 525: uint16(56), - 526: uint16(57), - 527: uint16(217), - 528: uint16(218), - 529: uint16(217), - 530: uint16(218), - 531: uint16(19), - 532: uint16(189), - 533: uint16(59), - 534: uint16(191), - 535: uint16(23), - 536: uint16(59), - 537: uint16(138), - 538: uint16(139), - 539: uint16(196), - 540: uint16(135), - 541: uint16(198), - 542: uint16(232), - 543: uint16(283), - 544: uint16(232), - 545: uint16(140), - 546: uint16(59), - 547: uint16(287), - 548: uint16(205), - 549: uint16(275), - 550: uint16(116), - 551: uint16(205), - 552: uint16(116), - 553: uint16(117), - 554: uint16(118), - 555: uint16(43), - 556: uint16(44), - 557: uint16(45), - 558: uint16(46), - 559: uint16(47), - 560: uint16(48), - 561: uint16(49), - 562: uint16(50), - 563: uint16(51), - 564: uint16(52), - 565: uint16(53), - 566: uint16(54), - 567: uint16(55), - 568: uint16(56), - 569: uint16(57), - 570: uint16(194), - 571: uint16(102), - 572: uint16(103), - 573: uint16(104), - 574: uint16(105), - 575: uint16(106), - 576: uint16(107), - 577: uint16(108), - 578: uint16(109), - 579: uint16(110), - 580: uint16(111), - 581: uint16(112), - 582: uint16(113), - 583: uint16(240), - 584: uint16(241), - 585: uint16(194), - 586: uint16(240), - 587: uint16(241), - 588: uint16(314), - 589: uint16(315), - 590: uint16(116), - 591: uint16(117), - 592: uint16(118), - 593: uint16(116), - 594: uint16(117), - 595: uint16(118), - 596: uint16(253), - 597: uint16(194), - 598: uint16(255), - 599: uint16(253), - 600: uint16(59), - 601: uint16(255), - 602: uint16(19), - 603: uint16(116), - 604: uint16(117), - 605: uint16(118), - 606: uint16(23), - 607: uint16(22), - 608: uint16(217), - 609: uint16(218), - 610: uint16(142), - 611: uint16(268), - 612: uint16(205), - 613: uint16(275), - 614: uint16(102), - 615: uint16(103), - 616: uint16(104), - 617: uint16(105), - 618: uint16(106), - 619: uint16(107), - 620: uint16(108), - 621: uint16(109), - 622: uint16(110), - 623: uint16(111), - 624: uint16(112), - 625: uint16(113), - 626: uint16(43), - 627: uint16(44), - 628: uint16(45), - 629: uint16(46), - 630: uint16(47), - 631: uint16(48), - 632: uint16(49), - 633: uint16(50), - 634: uint16(51), - 635: uint16(52), - 636: uint16(53), - 637: uint16(54), - 638: uint16(55), - 639: uint16(56), - 640: uint16(57), - 641: uint16(19), - 642: uint16(194), - 643: uint16(300), - 644: uint16(59), - 645: uint16(23), - 646: uint16(119), - 647: uint16(240), - 648: uint16(241), - 649: uint16(122), - 650: uint16(123), - 651: uint16(124), - 652: uint16(314), - 653: uint16(315), - 654: uint16(194), - 655: uint16(236), - 656: uint16(237), - 657: uint16(194), - 658: uint16(117), - 659: uint16(132), - 660: uint16(253), - 661: uint16(81), - 662: uint16(255), - 663: uint16(205), - 664: uint16(59), - 665: uint16(43), - 666: uint16(44), - 667: uint16(45), - 668: uint16(46), - 669: uint16(47), - 670: uint16(48), - 671: uint16(49), - 672: uint16(50), - 673: uint16(51), - 674: uint16(52), - 675: uint16(53), - 676: uint16(54), - 677: uint16(55), - 678: uint16(56), - 679: uint16(57), - 680: uint16(217), - 681: uint16(218), - 682: uint16(194), - 683: uint16(194), - 684: uint16(194), - 685: uint16(102), - 686: uint16(103), - 687: uint16(104), - 688: uint16(105), - 689: uint16(106), - 690: uint16(107), - 691: uint16(108), - 692: uint16(109), - 693: uint16(110), - 694: uint16(111), - 695: uint16(112), - 696: uint16(113), - 697: uint16(294), - 698: uint16(240), - 699: uint16(241), - 700: uint16(120), - 701: uint16(116), - 702: uint16(117), - 703: uint16(118), - 704: uint16(59), - 705: uint16(194), - 706: uint16(217), - 707: uint16(218), - 708: uint16(211), - 709: uint16(212), - 710: uint16(213), - 711: uint16(253), - 712: uint16(19), - 713: uint16(255), - 714: uint16(194), - 715: uint16(19), - 716: uint16(23), - 717: uint16(254), - 718: uint16(138), - 719: uint16(139), - 720: uint16(24), - 721: uint16(232), - 722: uint16(117), - 723: uint16(194), - 724: uint16(102), - 725: uint16(103), - 726: uint16(104), - 727: uint16(105), - 728: uint16(106), - 729: uint16(107), - 730: uint16(108), - 731: uint16(109), - 732: uint16(110), - 733: uint16(111), - 734: uint16(112), - 735: uint16(113), - 736: uint16(43), - 737: uint16(44), - 738: uint16(45), - 739: uint16(46), - 740: uint16(47), - 741: uint16(48), - 742: uint16(49), - 743: uint16(50), - 744: uint16(51), - 745: uint16(52), - 746: uint16(53), - 747: uint16(54), - 748: uint16(55), - 749: uint16(56), - 750: uint16(57), - 751: uint16(19), - 752: uint16(264), - 753: uint16(108), - 754: uint16(76), - 755: uint16(23), - 756: uint16(127), - 757: uint16(128), - 758: uint16(129), - 759: uint16(311), - 760: uint16(312), - 761: uint16(116), - 762: uint16(117), - 763: uint16(118), - 764: uint16(316), - 765: uint16(87), - 766: uint16(306), - 767: uint16(89), - 768: uint16(308), - 769: uint16(194), - 770: uint16(92), - 771: uint16(22), - 772: uint16(59), - 773: uint16(194), - 774: uint16(22), - 775: uint16(43), - 776: uint16(44), - 777: uint16(45), - 778: uint16(46), - 779: uint16(47), - 780: uint16(48), - 781: uint16(49), - 782: uint16(50), - 783: uint16(51), - 784: uint16(52), - 785: uint16(53), - 786: uint16(54), - 787: uint16(55), - 788: uint16(56), - 789: uint16(57), - 790: uint16(194), - 791: uint16(95), - 792: uint16(217), - 793: uint16(218), - 794: uint16(265), - 795: uint16(102), - 796: uint16(103), - 797: uint16(104), - 798: uint16(105), - 799: uint16(106), - 800: uint16(107), - 801: uint16(108), - 802: uint16(109), - 803: uint16(110), - 804: uint16(111), - 805: uint16(112), - 806: uint16(113), - 807: uint16(232), - 808: uint16(59), - 809: uint16(113), - 810: uint16(25), - 811: uint16(59), - 812: uint16(194), - 813: uint16(217), - 814: uint16(218), - 815: uint16(119), - 816: uint16(120), - 817: uint16(121), - 818: uint16(122), - 819: uint16(123), - 820: uint16(124), - 821: uint16(125), - 822: uint16(19), - 823: uint16(145), - 824: uint16(194), - 825: uint16(194), - 826: uint16(23), - 827: uint16(131), - 828: uint16(232), - 829: uint16(116), - 830: uint16(117), - 831: uint16(118), - 832: uint16(35), - 833: uint16(194), - 834: uint16(102), - 835: uint16(103), - 836: uint16(104), - 837: uint16(105), - 838: uint16(106), - 839: uint16(107), - 840: uint16(108), - 841: uint16(109), - 842: uint16(110), - 843: uint16(111), - 844: uint16(112), - 845: uint16(113), - 846: uint16(43), - 847: uint16(44), - 848: uint16(45), - 849: uint16(46), - 850: uint16(47), - 851: uint16(48), - 852: uint16(49), - 853: uint16(50), - 854: uint16(51), - 855: uint16(52), - 856: uint16(53), - 857: uint16(54), - 858: uint16(55), - 859: uint16(56), - 860: uint16(57), - 861: uint16(19), - 862: uint16(194), - 863: uint16(66), - 864: uint16(194), - 865: uint16(116), - 866: uint16(117), - 867: uint16(118), - 868: uint16(116), - 869: uint16(117), - 870: uint16(118), - 871: uint16(74), - 872: uint16(242), - 873: uint16(294), - 874: uint16(194), - 875: uint16(194), - 876: uint16(206), - 877: uint16(23), - 878: uint16(194), - 879: uint16(25), - 880: uint16(194), - 881: uint16(111), - 882: uint16(112), - 883: uint16(113), - 884: uint16(25), - 885: uint16(43), - 886: uint16(44), - 887: uint16(45), - 888: uint16(46), - 889: uint16(47), - 890: uint16(48), - 891: uint16(49), - 892: uint16(50), - 893: uint16(51), - 894: uint16(52), - 895: uint16(53), - 896: uint16(54), - 897: uint16(55), - 898: uint16(56), - 899: uint16(57), - 900: uint16(24), - 901: uint16(194), - 902: uint16(194), - 903: uint16(217), - 904: uint16(218), - 905: uint16(102), - 906: uint16(103), - 907: uint16(104), - 908: uint16(105), - 909: uint16(106), - 910: uint16(107), - 911: uint16(108), - 912: uint16(109), - 913: uint16(110), - 914: uint16(111), - 915: uint16(112), - 916: uint16(113), - 917: uint16(241), - 918: uint16(232), - 919: uint16(194), - 920: uint16(212), - 921: uint16(213), - 922: uint16(242), - 923: uint16(242), - 924: uint16(217), - 925: uint16(218), - 926: uint16(242), - 927: uint16(130), - 928: uint16(11), - 929: uint16(253), - 930: uint16(194), - 931: uint16(255), - 932: uint16(19), - 933: uint16(265), - 934: uint16(149), - 935: uint16(59), - 936: uint16(306), - 937: uint16(194), - 938: uint16(308), - 939: uint16(232), - 940: uint16(309), - 941: uint16(310), - 942: uint16(217), - 943: uint16(218), - 944: uint16(102), - 945: uint16(103), - 946: uint16(104), - 947: uint16(105), - 948: uint16(106), - 949: uint16(107), - 950: uint16(108), - 951: uint16(109), - 952: uint16(110), - 953: uint16(111), - 954: uint16(112), - 955: uint16(113), - 956: uint16(43), - 957: uint16(44), - 958: uint16(45), - 959: uint16(46), - 960: uint16(47), - 961: uint16(48), - 962: uint16(49), - 963: uint16(50), - 964: uint16(51), - 965: uint16(52), - 966: uint16(53), - 967: uint16(54), - 968: uint16(55), - 969: uint16(56), - 970: uint16(57), - 971: uint16(194), - 972: uint16(194), - 973: uint16(59), - 974: uint16(194), - 975: uint16(239), - 976: uint16(19), - 977: uint16(194), - 978: uint16(25), - 979: uint16(254), - 980: uint16(303), - 981: uint16(304), - 982: uint16(23), - 983: uint16(194), - 984: uint16(25), - 985: uint16(126), - 986: uint16(306), - 987: uint16(306), - 988: uint16(308), - 989: uint16(308), - 990: uint16(306), - 991: uint16(271), - 992: uint16(308), - 993: uint16(117), - 994: uint16(286), - 995: uint16(217), - 996: uint16(218), - 997: uint16(217), - 998: uint16(218), - 999: uint16(194), - 1000: uint16(194), - 1001: uint16(159), - 1002: uint16(45), - 1003: uint16(46), - 1004: uint16(47), - 1005: uint16(48), - 1006: uint16(49), - 1007: uint16(50), - 1008: uint16(51), - 1009: uint16(52), - 1010: uint16(53), - 1011: uint16(54), - 1012: uint16(55), - 1013: uint16(56), - 1014: uint16(57), - 1015: uint16(102), - 1016: uint16(103), - 1017: uint16(104), - 1018: uint16(105), - 1019: uint16(106), - 1020: uint16(107), - 1021: uint16(108), - 1022: uint16(109), - 1023: uint16(110), - 1024: uint16(111), - 1025: uint16(112), - 1026: uint16(113), - 1027: uint16(59), - 1028: uint16(239), - 1029: uint16(194), - 1030: uint16(116), - 1031: uint16(117), - 1032: uint16(118), - 1033: uint16(260), - 1034: uint16(254), - 1035: uint16(194), - 1036: uint16(240), - 1037: uint16(241), - 1038: uint16(194), - 1039: uint16(233), - 1040: uint16(205), - 1041: uint16(240), - 1042: uint16(241), - 1043: uint16(205), - 1044: uint16(239), - 1045: uint16(128), - 1046: uint16(129), - 1047: uint16(270), - 1048: uint16(265), - 1049: uint16(253), - 1050: uint16(194), - 1051: uint16(255), - 1052: uint16(217), - 1053: uint16(218), - 1054: uint16(253), - 1055: uint16(194), - 1056: uint16(255), - 1057: uint16(143), - 1058: uint16(280), - 1059: uint16(102), - 1060: uint16(103), - 1061: uint16(104), - 1062: uint16(105), - 1063: uint16(106), - 1064: uint16(107), - 1065: uint16(108), - 1066: uint16(109), - 1067: uint16(110), - 1068: uint16(111), - 1069: uint16(112), - 1070: uint16(113), - 1071: uint16(118), - 1072: uint16(159), - 1073: uint16(217), - 1074: uint16(218), - 1075: uint16(240), - 1076: uint16(241), - 1077: uint16(118), - 1078: uint16(240), - 1079: uint16(241), - 1080: uint16(194), - 1081: uint16(194), - 1082: uint16(194), - 1083: uint16(239), - 1084: uint16(116), - 1085: uint16(117), - 1086: uint16(118), - 1087: uint16(22), - 1088: uint16(253), - 1089: uint16(254), - 1090: uint16(255), - 1091: uint16(253), - 1092: uint16(19), - 1093: uint16(255), - 1094: uint16(233), - 1095: uint16(194), - 1096: uint16(143), - 1097: uint16(24), - 1098: uint16(263), - 1099: uint16(212), - 1100: uint16(213), - 1101: uint16(194), - 1102: uint16(143), - 1103: uint16(217), - 1104: uint16(218), - 1105: uint16(217), - 1106: uint16(218), - 1107: uint16(261), - 1108: uint16(262), - 1109: uint16(271), - 1110: uint16(254), - 1111: uint16(143), - 1112: uint16(19), - 1113: uint16(7), - 1114: uint16(8), - 1115: uint16(9), - 1116: uint16(43), - 1117: uint16(44), - 1118: uint16(45), - 1119: uint16(46), - 1120: uint16(47), - 1121: uint16(48), - 1122: uint16(49), - 1123: uint16(50), - 1124: uint16(51), - 1125: uint16(52), - 1126: uint16(53), - 1127: uint16(54), - 1128: uint16(55), - 1129: uint16(56), - 1130: uint16(57), - 1131: uint16(16), - 1132: uint16(19), - 1133: uint16(22), - 1134: uint16(23), - 1135: uint16(294), - 1136: uint16(43), - 1137: uint16(44), - 1138: uint16(45), - 1139: uint16(46), - 1140: uint16(47), - 1141: uint16(48), - 1142: uint16(49), - 1143: uint16(50), - 1144: uint16(51), - 1145: uint16(52), - 1146: uint16(53), - 1147: uint16(54), - 1148: uint16(55), - 1149: uint16(56), - 1150: uint16(57), - 1151: uint16(312), - 1152: uint16(194), - 1153: uint16(214), - 1154: uint16(21), - 1155: uint16(316), - 1156: uint16(43), - 1157: uint16(44), - 1158: uint16(45), - 1159: uint16(46), - 1160: uint16(47), - 1161: uint16(48), - 1162: uint16(49), - 1163: uint16(50), - 1164: uint16(51), - 1165: uint16(52), - 1166: uint16(53), - 1167: uint16(54), - 1168: uint16(55), - 1169: uint16(56), - 1170: uint16(57), - 1171: uint16(106), - 1172: uint16(107), - 1173: uint16(286), - 1174: uint16(194), - 1175: uint16(102), - 1176: uint16(103), - 1177: uint16(104), - 1178: uint16(105), - 1179: uint16(106), - 1180: uint16(107), - 1181: uint16(108), - 1182: uint16(109), - 1183: uint16(110), - 1184: uint16(111), - 1185: uint16(112), - 1186: uint16(113), - 1187: uint16(207), - 1188: uint16(158), - 1189: uint16(59), - 1190: uint16(160), - 1191: uint16(22), - 1192: uint16(77), - 1193: uint16(24), - 1194: uint16(79), - 1195: uint16(102), - 1196: uint16(103), - 1197: uint16(104), - 1198: uint16(105), - 1199: uint16(106), - 1200: uint16(107), - 1201: uint16(108), - 1202: uint16(109), - 1203: uint16(110), - 1204: uint16(111), - 1205: uint16(112), - 1206: uint16(113), - 1207: uint16(194), - 1208: uint16(194), - 1209: uint16(229), - 1210: uint16(194), - 1211: uint16(231), - 1212: uint16(101), - 1213: uint16(80), - 1214: uint16(22), - 1215: uint16(102), - 1216: uint16(103), - 1217: uint16(104), - 1218: uint16(105), - 1219: uint16(106), - 1220: uint16(107), - 1221: uint16(108), - 1222: uint16(109), - 1223: uint16(110), - 1224: uint16(111), - 1225: uint16(112), - 1226: uint16(113), - 1227: uint16(288), - 1228: uint16(59), - 1229: uint16(12), - 1230: uint16(217), - 1231: uint16(218), - 1232: uint16(293), - 1233: uint16(217), - 1234: uint16(218), - 1235: uint16(19), - 1236: uint16(106), - 1237: uint16(107), - 1238: uint16(59), - 1239: uint16(19), - 1240: uint16(16), - 1241: uint16(127), - 1242: uint16(128), - 1243: uint16(129), - 1244: uint16(27), - 1245: uint16(115), - 1246: uint16(116), - 1247: uint16(117), - 1248: uint16(118), - 1249: uint16(194), - 1250: uint16(120), - 1251: uint16(59), - 1252: uint16(22), - 1253: uint16(194), - 1254: uint16(24), - 1255: uint16(194), - 1256: uint16(123), - 1257: uint16(100), - 1258: uint16(128), - 1259: uint16(42), - 1260: uint16(44), - 1261: uint16(45), - 1262: uint16(46), - 1263: uint16(47), - 1264: uint16(48), - 1265: uint16(49), - 1266: uint16(50), - 1267: uint16(51), - 1268: uint16(52), - 1269: uint16(53), - 1270: uint16(54), - 1271: uint16(55), - 1272: uint16(56), - 1273: uint16(57), - 1274: uint16(117), - 1275: uint16(194), - 1276: uint16(217), - 1277: uint16(218), - 1278: uint16(121), - 1279: uint16(100), - 1280: uint16(63), - 1281: uint16(194), - 1282: uint16(245), - 1283: uint16(153), - 1284: uint16(194), - 1285: uint16(155), - 1286: uint16(117), - 1287: uint16(19), - 1288: uint16(115), - 1289: uint16(194), - 1290: uint16(73), - 1291: uint16(214), - 1292: uint16(194), - 1293: uint16(256), - 1294: uint16(161), - 1295: uint16(116), - 1296: uint16(117), - 1297: uint16(194), - 1298: uint16(217), - 1299: uint16(218), - 1300: uint16(121), - 1301: uint16(77), - 1302: uint16(194), - 1303: uint16(79), - 1304: uint16(217), - 1305: uint16(218), - 1306: uint16(194), - 1307: uint16(217), - 1308: uint16(218), - 1309: uint16(117), - 1310: uint16(153), - 1311: uint16(154), - 1312: uint16(155), - 1313: uint16(254), - 1314: uint16(46), - 1315: uint16(217), - 1316: uint16(218), - 1317: uint16(144), - 1318: uint16(102), - 1319: uint16(103), - 1320: uint16(104), - 1321: uint16(105), - 1322: uint16(106), - 1323: uint16(107), - 1324: uint16(108), - 1325: uint16(109), - 1326: uint16(110), - 1327: uint16(111), - 1328: uint16(112), - 1329: uint16(113), - 1330: uint16(232), - 1331: uint16(270), - 1332: uint16(153), - 1333: uint16(154), - 1334: uint16(155), - 1335: uint16(115), - 1336: uint16(116), - 1337: uint16(66), - 1338: uint16(19), - 1339: uint16(20), - 1340: uint16(183), - 1341: uint16(22), - 1342: uint16(12), - 1343: uint16(312), - 1344: uint16(254), - 1345: uint16(194), - 1346: uint16(262), - 1347: uint16(316), - 1348: uint16(209), - 1349: uint16(210), - 1350: uint16(266), - 1351: uint16(239), - 1352: uint16(194), - 1353: uint16(194), - 1354: uint16(108), - 1355: uint16(36), - 1356: uint16(85), - 1357: uint16(27), - 1358: uint16(19), - 1359: uint16(20), - 1360: uint16(265), - 1361: uint16(22), - 1362: uint16(183), - 1363: uint16(245), - 1364: uint16(144), - 1365: uint16(94), - 1366: uint16(25), - 1367: uint16(48), - 1368: uint16(217), - 1369: uint16(218), - 1370: uint16(293), - 1371: uint16(194), - 1372: uint16(42), - 1373: uint16(270), - 1374: uint16(256), - 1375: uint16(36), - 1376: uint16(217), - 1377: uint16(218), - 1378: uint16(59), - 1379: uint16(194), - 1380: uint16(25), - 1381: uint16(135), - 1382: uint16(194), - 1383: uint16(115), - 1384: uint16(194), - 1385: uint16(161), - 1386: uint16(140), - 1387: uint16(194), - 1388: uint16(194), - 1389: uint16(15), - 1390: uint16(71), - 1391: uint16(194), - 1392: uint16(312), - 1393: uint16(63), - 1394: uint16(217), - 1395: uint16(218), - 1396: uint16(316), - 1397: uint16(194), - 1398: uint16(59), - 1399: uint16(131), - 1400: uint16(301), - 1401: uint16(302), - 1402: uint16(217), - 1403: uint16(218), - 1404: uint16(85), - 1405: uint16(217), - 1406: uint16(218), - 1407: uint16(217), - 1408: uint16(218), - 1409: uint16(90), - 1410: uint16(71), - 1411: uint16(217), - 1412: uint16(218), - 1413: uint16(19), - 1414: uint16(217), - 1415: uint16(218), - 1416: uint16(245), - 1417: uint16(146), - 1418: uint16(262), - 1419: uint16(100), - 1420: uint16(217), + 154: uint16(114), + 155: uint16(43), + 156: uint16(44), + 157: uint16(45), + 158: uint16(195), + 159: uint16(47), + 160: uint16(48), + 161: uint16(49), + 162: uint16(50), + 163: uint16(51), + 164: uint16(52), + 165: uint16(53), + 166: uint16(54), + 167: uint16(55), + 168: uint16(56), + 169: uint16(57), + 170: uint16(58), + 171: uint16(60), + 172: uint16(21), + 173: uint16(195), + 174: uint16(241), + 175: uint16(242), + 176: uint16(215), + 177: uint16(241), + 178: uint16(242), + 179: uint16(312), + 180: uint16(313), + 181: uint16(102), + 182: uint16(70), + 183: uint16(205), + 184: uint16(317), + 185: uint16(207), + 186: uint16(242), + 187: uint16(254), + 188: uint16(77), + 189: uint16(256), + 190: uint16(254), + 191: uint16(122), + 192: uint16(256), + 193: uint16(55), + 194: uint16(56), + 195: uint16(57), + 196: uint16(58), + 197: uint16(59), + 198: uint16(254), + 199: uint16(88), + 200: uint16(256), + 201: uint16(90), + 202: uint16(269), + 203: uint16(240), + 204: uint16(93), + 205: uint16(269), + 206: uint16(107), + 207: uint16(108), + 208: uint16(109), + 209: uint16(110), + 210: uint16(111), + 211: uint16(112), + 212: uint16(113), + 213: uint16(114), + 214: uint16(271), + 215: uint16(103), + 216: uint16(104), + 217: uint16(105), + 218: uint16(106), + 219: uint16(107), + 220: uint16(108), + 221: uint16(109), + 222: uint16(110), + 223: uint16(111), + 224: uint16(112), + 225: uint16(113), + 226: uint16(114), + 227: uint16(313), + 228: uint16(117), + 229: uint16(118), + 230: uint16(119), + 231: uint16(317), + 232: uint16(81), + 233: uint16(195), + 234: uint16(301), + 235: uint16(19), + 236: uint16(195), + 237: uint16(301), + 238: uint16(277), + 239: uint16(278), + 240: uint16(279), + 241: uint16(103), + 242: uint16(104), + 243: uint16(105), + 244: uint16(106), + 245: uint16(107), + 246: uint16(108), + 247: uint16(109), + 248: uint16(110), + 249: uint16(111), + 250: uint16(112), + 251: uint16(113), + 252: uint16(114), + 253: uint16(55), + 254: uint16(56), + 255: uint16(57), + 256: uint16(58), + 257: uint16(146), + 258: uint16(195), + 259: uint16(43), + 260: uint16(44), + 261: uint16(45), + 262: uint16(74), + 263: uint16(47), + 264: uint16(48), + 265: uint16(49), + 266: uint16(50), + 267: uint16(51), + 268: uint16(52), + 269: uint16(53), + 270: uint16(54), + 271: uint16(55), + 272: uint16(56), + 273: uint16(57), + 274: uint16(58), + 275: uint16(124), + 276: uint16(195), + 277: uint16(60), + 278: uint16(109), + 279: uint16(110), + 280: uint16(111), + 281: uint16(112), + 282: uint16(113), + 283: uint16(114), + 284: uint16(68), + 285: uint16(195), + 286: uint16(103), + 287: uint16(104), + 288: uint16(105), + 289: uint16(106), + 290: uint16(107), + 291: uint16(108), + 292: uint16(109), + 293: uint16(110), + 294: uint16(111), + 295: uint16(112), + 296: uint16(113), + 297: uint16(114), + 298: uint16(208), + 299: uint16(218), + 300: uint16(219), + 301: uint16(103), + 302: uint16(104), + 303: uint16(105), + 304: uint16(106), + 305: uint16(107), + 306: uint16(108), + 307: uint16(109), + 308: uint16(110), + 309: uint16(111), + 310: uint16(112), + 311: uint16(113), + 312: uint16(114), + 313: uint16(162), + 314: uint16(233), + 315: uint16(24), + 316: uint16(128), + 317: uint16(129), + 318: uint16(130), + 319: uint16(103), + 320: uint16(104), + 321: uint16(105), + 322: uint16(106), + 323: uint16(107), + 324: uint16(108), + 325: uint16(109), + 326: uint16(110), + 327: uint16(111), + 328: uint16(112), + 329: uint16(113), + 330: uint16(114), + 331: uint16(195), + 332: uint16(195), + 333: uint16(215), + 334: uint16(117), + 335: uint16(118), + 336: uint16(119), + 337: uint16(120), + 338: uint16(195), + 339: uint16(19), + 340: uint16(123), + 341: uint16(124), + 342: uint16(125), + 343: uint16(207), + 344: uint16(24), + 345: uint16(74), + 346: uint16(246), + 347: uint16(60), + 348: uint16(310), + 349: uint16(311), + 350: uint16(133), + 351: uint16(60), + 352: uint16(311), + 353: uint16(82), + 354: uint16(22), + 355: uint16(218), + 356: uint16(219), + 357: uint16(257), + 358: uint16(195), + 359: uint16(19), + 360: uint16(73), + 361: uint16(218), + 362: uint16(219), + 363: uint16(43), + 364: uint16(44), + 365: uint16(45), + 366: uint16(206), + 367: uint16(47), + 368: uint16(48), + 369: uint16(49), + 370: uint16(50), + 371: uint16(51), + 372: uint16(52), + 373: uint16(53), + 374: uint16(54), + 375: uint16(55), + 376: uint16(56), + 377: uint16(57), + 378: uint16(58), + 379: uint16(22), + 380: uint16(23), + 381: uint16(218), + 382: uint16(219), + 383: uint16(43), + 384: uint16(44), + 385: uint16(45), + 386: uint16(54), + 387: uint16(47), + 388: uint16(48), + 389: uint16(49), + 390: uint16(50), + 391: uint16(51), + 392: uint16(52), + 393: uint16(53), + 394: uint16(54), + 395: uint16(55), + 396: uint16(56), + 397: uint16(57), + 398: uint16(58), + 399: uint16(128), + 400: uint16(82), + 401: uint16(241), + 402: uint16(242), + 403: uint16(195), + 404: uint16(117), + 405: uint16(118), + 406: uint16(119), + 407: uint16(289), + 408: uint16(60), + 409: uint16(118), + 410: uint16(139), + 411: uint16(140), + 412: uint16(294), + 413: uint16(195), + 414: uint16(254), + 415: uint16(195), + 416: uint16(256), + 417: uint16(195), + 418: uint16(255), + 419: uint16(259), + 420: uint16(260), + 421: uint16(73), + 422: uint16(22), + 423: uint16(103), + 424: uint16(104), + 425: uint16(105), + 426: uint16(106), + 427: uint16(107), + 428: uint16(108), + 429: uint16(109), + 430: uint16(110), + 431: uint16(111), + 432: uint16(112), + 433: uint16(113), + 434: uint16(114), + 435: uint16(206), + 436: uint16(218), + 437: uint16(219), + 438: uint16(218), + 439: uint16(219), + 440: uint16(218), + 441: uint16(219), + 442: uint16(234), + 443: uint16(103), + 444: uint16(104), + 445: uint16(105), + 446: uint16(106), + 447: uint16(107), + 448: uint16(108), + 449: uint16(109), + 450: uint16(110), + 451: uint16(111), + 452: uint16(112), + 453: uint16(113), + 454: uint16(114), + 455: uint16(318), + 456: uint16(319), + 457: uint16(139), + 458: uint16(140), + 459: uint16(102), + 460: uint16(60), + 461: uint16(318), + 462: uint16(319), + 463: uint16(221), + 464: uint16(19), + 465: uint16(117), + 466: uint16(118), + 467: uint16(119), + 468: uint16(23), + 469: uint16(195), + 470: uint16(241), + 471: uint16(242), + 472: uint16(313), + 473: uint16(255), + 474: uint16(206), + 475: uint16(255), + 476: uint16(317), + 477: uint16(255), + 478: uint16(206), + 479: uint16(129), + 480: uint16(130), + 481: uint16(206), + 482: uint16(264), + 483: uint16(254), + 484: uint16(264), + 485: uint16(256), + 486: uint16(264), + 487: uint16(195), + 488: uint16(43), + 489: uint16(44), + 490: uint16(45), + 491: uint16(151), + 492: uint16(47), + 493: uint16(48), + 494: uint16(49), + 495: uint16(50), + 496: uint16(51), + 497: uint16(52), + 498: uint16(53), + 499: uint16(54), + 500: uint16(55), + 501: uint16(56), + 502: uint16(57), + 503: uint16(58), + 504: uint16(246), + 505: uint16(213), + 506: uint16(214), + 507: uint16(19), + 508: uint16(19), + 509: uint16(241), + 510: uint16(242), + 511: uint16(195), + 512: uint16(23), + 513: uint16(241), + 514: uint16(242), + 515: uint16(257), + 516: uint16(241), + 517: uint16(242), + 518: uint16(118), + 519: uint16(277), + 520: uint16(278), + 521: uint16(279), + 522: uint16(254), + 523: uint16(29), + 524: uint16(256), + 525: uint16(60), + 526: uint16(254), + 527: uint16(33), + 528: uint16(256), + 529: uint16(254), + 530: uint16(206), + 531: uint16(256), + 532: uint16(43), + 533: uint16(44), + 534: uint16(45), + 535: uint16(218), + 536: uint16(47), + 537: uint16(48), + 538: uint16(49), + 539: uint16(50), + 540: uint16(51), + 541: uint16(52), + 542: uint16(53), + 543: uint16(54), + 544: uint16(55), + 545: uint16(56), + 546: uint16(57), + 547: uint16(58), + 548: uint16(103), + 549: uint16(104), + 550: uint16(105), + 551: uint16(106), + 552: uint16(107), + 553: uint16(108), + 554: uint16(109), + 555: uint16(110), + 556: uint16(111), + 557: uint16(112), + 558: uint16(113), + 559: uint16(114), + 560: uint16(66), + 561: uint16(19), + 562: uint16(218), + 563: uint16(60), + 564: uint16(120), + 565: uint16(241), + 566: uint16(242), + 567: uint16(123), + 568: uint16(124), + 569: uint16(125), + 570: uint16(60), + 571: uint16(232), + 572: uint16(77), + 573: uint16(19), + 574: uint16(20), + 575: uint16(26), + 576: uint16(22), + 577: uint16(133), + 578: uint16(254), + 579: uint16(287), + 580: uint16(256), + 581: uint16(265), + 582: uint16(117), + 583: uint16(118), + 584: uint16(119), + 585: uint16(90), + 586: uint16(312), + 587: uint16(313), + 588: uint16(93), + 589: uint16(47), + 590: uint16(36), + 591: uint16(317), + 592: uint16(103), + 593: uint16(104), + 594: uint16(105), + 595: uint16(106), + 596: uint16(107), + 597: uint16(108), + 598: uint16(109), + 599: uint16(110), + 600: uint16(111), + 601: uint16(112), + 602: uint16(113), + 603: uint16(114), + 604: uint16(116), + 605: uint16(117), + 606: uint16(277), + 607: uint16(278), + 608: uint16(279), + 609: uint16(60), + 610: uint16(107), + 611: uint16(108), + 612: uint16(19), + 613: uint16(276), + 614: uint16(60), + 615: uint16(31), + 616: uint16(23), + 617: uint16(152), + 618: uint16(195), + 619: uint16(116), + 620: uint16(117), + 621: uint16(118), + 622: uint16(119), + 623: uint16(39), + 624: uint16(121), + 625: uint16(276), + 626: uint16(72), + 627: uint16(117), + 628: uint16(118), + 629: uint16(119), + 630: uint16(166), + 631: uint16(167), + 632: uint16(129), + 633: uint16(145), + 634: uint16(237), + 635: uint16(238), + 636: uint16(43), + 637: uint16(44), + 638: uint16(45), + 639: uint16(276), + 640: uint16(47), + 641: uint16(48), + 642: uint16(49), + 643: uint16(50), + 644: uint16(51), + 645: uint16(52), + 646: uint16(53), + 647: uint16(54), + 648: uint16(55), + 649: uint16(56), + 650: uint16(57), + 651: uint16(58), + 652: uint16(315), + 653: uint16(316), + 654: uint16(144), + 655: uint16(101), + 656: uint16(19), + 657: uint16(154), + 658: uint16(116), + 659: uint16(156), + 660: uint16(23), + 661: uint16(107), + 662: uint16(108), + 663: uint16(109), + 664: uint16(315), + 665: uint16(316), + 666: uint16(117), + 667: uint16(118), + 668: uint16(119), + 669: uint16(115), + 670: uint16(60), + 671: uint16(117), + 672: uint16(118), + 673: uint16(119), + 674: uint16(132), + 675: uint16(200), + 676: uint16(122), + 677: uint16(60), + 678: uint16(315), + 679: uint16(316), + 680: uint16(43), + 681: uint16(44), + 682: uint16(45), + 683: uint16(272), + 684: uint16(47), + 685: uint16(48), + 686: uint16(49), + 687: uint16(50), + 688: uint16(51), + 689: uint16(52), + 690: uint16(53), + 691: uint16(54), + 692: uint16(55), + 693: uint16(56), + 694: uint16(57), + 695: uint16(58), + 696: uint16(103), + 697: uint16(104), + 698: uint16(105), + 699: uint16(106), + 700: uint16(107), + 701: uint16(108), + 702: uint16(109), + 703: uint16(110), + 704: uint16(111), + 705: uint16(112), + 706: uint16(113), + 707: uint16(114), + 708: uint16(154), + 709: uint16(155), + 710: uint16(156), + 711: uint16(157), + 712: uint16(158), + 713: uint16(212), + 714: uint16(213), + 715: uint16(214), + 716: uint16(22), + 717: uint16(195), + 718: uint16(101), + 719: uint16(22), + 720: uint16(60), + 721: uint16(19), + 722: uint16(20), + 723: uint16(60), + 724: uint16(22), + 725: uint16(139), + 726: uint16(140), + 727: uint16(117), + 728: uint16(118), + 729: uint16(119), + 730: uint16(22), + 731: uint16(251), + 732: uint16(195), + 733: uint16(253), + 734: uint16(117), + 735: uint16(118), + 736: uint16(195), + 737: uint16(183), + 738: uint16(36), + 739: uint16(122), + 740: uint16(103), + 741: uint16(104), + 742: uint16(105), + 743: uint16(106), + 744: uint16(107), + 745: uint16(108), + 746: uint16(109), + 747: uint16(110), + 748: uint16(111), + 749: uint16(112), + 750: uint16(113), + 751: uint16(114), + 752: uint16(195), + 753: uint16(195), + 754: uint16(60), + 755: uint16(218), + 756: uint16(219), + 757: uint16(60), + 758: uint16(195), + 759: uint16(284), + 760: uint16(19), + 761: uint16(25), + 762: uint16(60), + 763: uint16(288), + 764: uint16(23), + 765: uint16(237), + 766: uint16(238), + 767: uint16(22), + 768: uint16(60), + 769: uint16(109), + 770: uint16(233), + 771: uint16(154), + 772: uint16(155), + 773: uint16(156), + 774: uint16(72), + 775: uint16(218), + 776: uint16(219), + 777: uint16(117), + 778: uint16(118), + 779: uint16(119), + 780: uint16(117), + 781: uint16(118), + 782: uint16(119), + 783: uint16(116), + 784: uint16(43), + 785: uint16(44), + 786: uint16(45), + 787: uint16(265), + 788: uint16(47), + 789: uint16(48), + 790: uint16(49), + 791: uint16(50), + 792: uint16(51), + 793: uint16(52), + 794: uint16(53), + 795: uint16(54), + 796: uint16(55), + 797: uint16(56), + 798: uint16(57), + 799: uint16(58), + 800: uint16(183), + 801: uint16(243), + 802: uint16(25), + 803: uint16(101), + 804: uint16(19), + 805: uint16(60), + 806: uint16(265), + 807: uint16(144), + 808: uint16(23), + 809: uint16(107), + 810: uint16(108), + 811: uint16(117), + 812: uint16(118), + 813: uint16(119), + 814: uint16(117), + 815: uint16(118), + 816: uint16(119), + 817: uint16(115), + 818: uint16(151), + 819: uint16(117), + 820: uint16(118), + 821: uint16(119), + 822: uint16(82), + 823: uint16(195), + 824: uint16(122), + 825: uint16(117), + 826: uint16(118), + 827: uint16(119), + 828: uint16(43), + 829: uint16(44), + 830: uint16(45), + 831: uint16(195), + 832: uint16(47), + 833: uint16(48), + 834: uint16(49), + 835: uint16(50), + 836: uint16(51), + 837: uint16(52), + 838: uint16(53), + 839: uint16(54), + 840: uint16(55), + 841: uint16(56), + 842: uint16(57), + 843: uint16(58), + 844: uint16(103), + 845: uint16(104), + 846: uint16(105), + 847: uint16(106), + 848: uint16(107), + 849: uint16(108), + 850: uint16(109), + 851: uint16(110), + 852: uint16(111), + 853: uint16(112), + 854: uint16(113), + 855: uint16(114), + 856: uint16(154), + 857: uint16(155), + 858: uint16(156), + 859: uint16(157), + 860: uint16(158), + 861: uint16(121), + 862: uint16(117), + 863: uint16(118), + 864: uint16(119), + 865: uint16(307), + 866: uint16(101), + 867: uint16(309), + 868: uint16(195), + 869: uint16(22), + 870: uint16(23), + 871: uint16(195), + 872: uint16(25), + 873: uint16(19), + 874: uint16(35), + 875: uint16(139), + 876: uint16(140), + 877: uint16(195), + 878: uint16(24), + 879: uint16(139), + 880: uint16(140), + 881: uint16(208), + 882: uint16(195), + 883: uint16(118), + 884: uint16(109), + 885: uint16(183), + 886: uint16(22), + 887: uint16(122), + 888: uint16(103), + 889: uint16(104), + 890: uint16(105), + 891: uint16(106), + 892: uint16(107), + 893: uint16(108), + 894: uint16(109), + 895: uint16(110), + 896: uint16(111), + 897: uint16(112), + 898: uint16(113), + 899: uint16(114), + 900: uint16(304), + 901: uint16(305), + 902: uint16(77), + 903: uint16(230), + 904: uint16(127), + 905: uint16(232), + 906: uint16(67), + 907: uint16(195), + 908: uint16(19), + 909: uint16(195), + 910: uint16(195), + 911: uint16(136), + 912: uint16(23), + 913: uint16(88), + 914: uint16(75), + 915: uint16(90), + 916: uint16(141), + 917: uint16(203), + 918: uint16(93), + 919: uint16(154), + 920: uint16(155), + 921: uint16(156), + 922: uint16(208), + 923: uint16(295), + 924: uint16(60), + 925: uint16(243), + 926: uint16(22), + 927: uint16(23), + 928: uint16(19), + 929: uint16(25), + 930: uint16(218), + 931: uint16(219), + 932: uint16(43), + 933: uint16(44), + 934: uint16(45), + 935: uint16(100), + 936: uint16(47), + 937: uint16(48), + 938: uint16(49), + 939: uint16(50), + 940: uint16(51), + 941: uint16(52), + 942: uint16(53), + 943: uint16(54), + 944: uint16(55), + 945: uint16(56), + 946: uint16(57), + 947: uint16(58), + 948: uint16(183), + 949: uint16(102), + 950: uint16(96), + 951: uint16(195), + 952: uint16(43), + 953: uint16(44), + 954: uint16(45), + 955: uint16(240), + 956: uint16(47), + 957: uint16(48), + 958: uint16(49), + 959: uint16(50), + 960: uint16(51), + 961: uint16(52), + 962: uint16(53), + 963: uint16(54), + 964: uint16(55), + 965: uint16(56), + 966: uint16(57), + 967: uint16(58), + 968: uint16(114), + 969: uint16(134), + 970: uint16(131), + 971: uint16(146), + 972: uint16(25), + 973: uint16(286), + 974: uint16(120), + 975: uint16(121), + 976: uint16(122), + 977: uint16(123), + 978: uint16(124), + 979: uint16(125), + 980: uint16(126), + 981: uint16(117), + 982: uint16(118), + 983: uint16(119), + 984: uint16(313), + 985: uint16(195), + 986: uint16(132), + 987: uint16(195), + 988: uint16(317), + 989: uint16(307), + 990: uint16(195), + 991: uint16(309), + 992: uint16(103), + 993: uint16(104), + 994: uint16(105), + 995: uint16(106), + 996: uint16(107), + 997: uint16(108), + 998: uint16(109), + 999: uint16(110), + 1000: uint16(111), + 1001: uint16(112), + 1002: uint16(113), + 1003: uint16(114), + 1004: uint16(195), + 1005: uint16(195), + 1006: uint16(102), + 1007: uint16(195), + 1008: uint16(195), + 1009: uint16(195), + 1010: uint16(218), + 1011: uint16(219), + 1012: uint16(103), + 1013: uint16(104), + 1014: uint16(105), + 1015: uint16(106), + 1016: uint16(107), + 1017: uint16(108), + 1018: uint16(109), + 1019: uint16(110), + 1020: uint16(111), + 1021: uint16(112), + 1022: uint16(113), + 1023: uint16(114), + 1024: uint16(77), + 1025: uint16(233), + 1026: uint16(195), + 1027: uint16(60), + 1028: uint16(218), + 1029: uint16(219), + 1030: uint16(218), + 1031: uint16(219), + 1032: uint16(218), + 1033: uint16(219), + 1034: uint16(23), + 1035: uint16(195), + 1036: uint16(25), + 1037: uint16(90), + 1038: uint16(243), + 1039: uint16(159), + 1040: uint16(93), + 1041: uint16(161), + 1042: uint16(19), + 1043: uint16(233), + 1044: uint16(195), + 1045: uint16(233), + 1046: uint16(23), + 1047: uint16(233), + 1048: uint16(16), + 1049: uint16(218), + 1050: uint16(219), + 1051: uint16(195), + 1052: uint16(243), + 1053: uint16(212), + 1054: uint16(213), + 1055: uint16(214), + 1056: uint16(262), + 1057: uint16(263), + 1058: uint16(218), + 1059: uint16(219), + 1060: uint16(195), + 1061: uint16(271), + 1062: uint16(19), + 1063: uint16(307), + 1064: uint16(233), + 1065: uint16(309), + 1066: uint16(43), + 1067: uint16(44), + 1068: uint16(45), + 1069: uint16(160), + 1070: uint16(47), + 1071: uint16(48), + 1072: uint16(49), + 1073: uint16(50), + 1074: uint16(51), + 1075: uint16(52), + 1076: uint16(53), + 1077: uint16(54), + 1078: uint16(55), + 1079: uint16(56), + 1080: uint16(57), + 1081: uint16(58), + 1082: uint16(195), + 1083: uint16(218), + 1084: uint16(219), + 1085: uint16(118), + 1086: uint16(43), + 1087: uint16(44), + 1088: uint16(45), + 1089: uint16(240), + 1090: uint16(47), + 1091: uint16(48), + 1092: uint16(49), + 1093: uint16(50), + 1094: uint16(51), + 1095: uint16(52), + 1096: uint16(53), + 1097: uint16(54), + 1098: uint16(55), + 1099: uint16(56), + 1100: uint16(57), + 1101: uint16(58), + 1102: uint16(307), + 1103: uint16(195), + 1104: uint16(309), + 1105: uint16(218), + 1106: uint16(219), + 1107: uint16(263), + 1108: uint16(12), + 1109: uint16(195), + 1110: uint16(78), + 1111: uint16(267), + 1112: uint16(80), + 1113: uint16(112), + 1114: uint16(113), + 1115: uint16(114), + 1116: uint16(307), + 1117: uint16(22), + 1118: uint16(309), + 1119: uint16(24), + 1120: uint16(255), + 1121: uint16(281), + 1122: uint16(266), + 1123: uint16(27), + 1124: uint16(107), + 1125: uint16(108), + 1126: uint16(103), + 1127: uint16(104), + 1128: uint16(105), + 1129: uint16(106), + 1130: uint16(107), + 1131: uint16(108), + 1132: uint16(109), + 1133: uint16(110), + 1134: uint16(111), + 1135: uint16(112), + 1136: uint16(113), + 1137: uint16(114), + 1138: uint16(42), + 1139: uint16(195), + 1140: uint16(11), + 1141: uint16(22), + 1142: uint16(255), + 1143: uint16(24), + 1144: uint16(195), + 1145: uint16(195), + 1146: uint16(103), + 1147: uint16(104), + 1148: uint16(105), + 1149: uint16(106), + 1150: uint16(107), + 1151: uint16(108), + 1152: uint16(109), + 1153: uint16(110), + 1154: uint16(111), + 1155: uint16(112), + 1156: uint16(113), + 1157: uint16(114), + 1158: uint16(19), + 1159: uint16(195), + 1160: uint16(64), + 1161: uint16(195), + 1162: uint16(218), + 1163: uint16(219), + 1164: uint16(195), + 1165: uint16(313), + 1166: uint16(195), + 1167: uint16(218), + 1168: uint16(219), + 1169: uint16(317), + 1170: uint16(74), + 1171: uint16(154), + 1172: uint16(195), + 1173: uint16(156), + 1174: uint16(195), + 1175: uint16(195), + 1176: uint16(19), + 1177: uint16(233), + 1178: uint16(23), + 1179: uint16(60), + 1180: uint16(25), + 1181: uint16(24), + 1182: uint16(218), + 1183: uint16(219), + 1184: uint16(218), + 1185: uint16(219), + 1186: uint16(195), + 1187: uint16(218), + 1188: uint16(219), + 1189: uint16(218), + 1190: uint16(219), + 1191: uint16(128), + 1192: uint16(129), + 1193: uint16(130), + 1194: uint16(162), + 1195: uint16(263), + 1196: uint16(19), + 1197: uint16(218), + 1198: uint16(219), + 1199: uint16(267), + 1200: uint16(43), + 1201: uint16(44), + 1202: uint16(45), + 1203: uint16(160), + 1204: uint16(47), + 1205: uint16(48), + 1206: uint16(49), + 1207: uint16(50), + 1208: uint16(51), + 1209: uint16(52), + 1210: uint16(53), + 1211: uint16(54), + 1212: uint16(55), + 1213: uint16(56), + 1214: uint16(57), + 1215: uint16(58), + 1216: uint16(19), + 1217: uint16(240), + 1218: uint16(228), + 1219: uint16(255), + 1220: uint16(43), + 1221: uint16(44), + 1222: uint16(45), + 1223: uint16(25), + 1224: uint16(47), + 1225: uint16(48), + 1226: uint16(49), + 1227: uint16(50), + 1228: uint16(51), + 1229: uint16(52), + 1230: uint16(53), + 1231: uint16(54), + 1232: uint16(55), + 1233: uint16(56), + 1234: uint16(57), + 1235: uint16(58), + 1236: uint16(135), + 1237: uint16(118), + 1238: uint16(137), + 1239: uint16(138), + 1240: uint16(43), + 1241: uint16(44), + 1242: uint16(45), + 1243: uint16(22), + 1244: uint16(47), + 1245: uint16(48), + 1246: uint16(49), + 1247: uint16(50), + 1248: uint16(51), + 1249: uint16(52), + 1250: uint16(53), + 1251: uint16(54), + 1252: uint16(55), + 1253: uint16(56), + 1254: uint16(57), + 1255: uint16(58), + 1256: uint16(117), + 1257: uint16(266), + 1258: uint16(129), + 1259: uint16(130), + 1260: uint16(103), + 1261: uint16(104), + 1262: uint16(105), + 1263: uint16(106), + 1264: uint16(107), + 1265: uint16(108), + 1266: uint16(109), + 1267: uint16(110), + 1268: uint16(111), + 1269: uint16(112), + 1270: uint16(113), + 1271: uint16(114), + 1272: uint16(195), + 1273: uint16(195), + 1274: uint16(119), + 1275: uint16(295), + 1276: uint16(195), + 1277: uint16(206), + 1278: uint16(195), + 1279: uint16(195), + 1280: uint16(103), + 1281: uint16(104), + 1282: uint16(105), + 1283: uint16(106), + 1284: uint16(107), + 1285: uint16(108), + 1286: uint16(109), + 1287: uint16(110), + 1288: uint16(111), + 1289: uint16(112), + 1290: uint16(113), + 1291: uint16(114), + 1292: uint16(195), + 1293: uint16(195), + 1294: uint16(195), + 1295: uint16(218), + 1296: uint16(219), + 1297: uint16(195), + 1298: uint16(195), + 1299: uint16(144), + 1300: uint16(103), + 1301: uint16(104), + 1302: uint16(105), + 1303: uint16(106), + 1304: uint16(107), + 1305: uint16(108), + 1306: uint16(109), + 1307: uint16(110), + 1308: uint16(111), + 1309: uint16(112), + 1310: uint16(113), + 1311: uint16(114), + 1312: uint16(241), + 1313: uint16(242), + 1314: uint16(67), + 1315: uint16(218), + 1316: uint16(219), + 1317: uint16(218), + 1318: uint16(219), + 1319: uint16(146), + 1320: uint16(19), + 1321: uint16(218), + 1322: uint16(219), + 1323: uint16(240), + 1324: uint16(215), + 1325: uint16(254), + 1326: uint16(136), + 1327: uint16(256), + 1328: uint16(107), + 1329: uint16(108), + 1330: uint16(195), + 1331: uint16(141), + 1332: uint16(255), + 1333: uint16(86), + 1334: uint16(128), + 1335: uint16(129), + 1336: uint16(130), + 1337: uint16(195), + 1338: uint16(165), + 1339: uint16(195), + 1340: uint16(19), + 1341: uint16(143), + 1342: uint16(95), + 1343: uint16(272), + 1344: uint16(25), + 1345: uint16(44), + 1346: uint16(45), + 1347: uint16(266), + 1348: uint16(47), + 1349: uint16(48), + 1350: uint16(49), + 1351: uint16(50), + 1352: uint16(51), + 1353: uint16(52), + 1354: uint16(53), + 1355: uint16(54), + 1356: uint16(55), + 1357: uint16(56), + 1358: uint16(57), + 1359: uint16(58), + 1360: uint16(218), + 1361: uint16(219), + 1362: uint16(218), + 1363: uint16(219), + 1364: uint16(195), + 1365: uint16(12), + 1366: uint16(45), + 1367: uint16(195), + 1368: uint16(47), + 1369: uint16(48), + 1370: uint16(49), + 1371: uint16(50), + 1372: uint16(51), + 1373: uint16(52), + 1374: uint16(53), + 1375: uint16(54), + 1376: uint16(55), + 1377: uint16(56), + 1378: uint16(57), + 1379: uint16(58), + 1380: uint16(27), + 1381: uint16(23), + 1382: uint16(7), + 1383: uint16(8), + 1384: uint16(9), + 1385: uint16(210), + 1386: uint16(211), + 1387: uint16(218), + 1388: uint16(219), + 1389: uint16(116), + 1390: uint16(218), + 1391: uint16(219), + 1392: uint16(228), + 1393: uint16(16), + 1394: uint16(147), + 1395: uint16(42), + 1396: uint16(195), + 1397: uint16(295), + 1398: uint16(195), + 1399: uint16(19), + 1400: uint16(20), + 1401: uint16(266), + 1402: uint16(22), + 1403: uint16(294), + 1404: uint16(103), + 1405: uint16(104), + 1406: uint16(105), + 1407: uint16(106), + 1408: uint16(107), + 1409: uint16(108), + 1410: uint16(109), + 1411: uint16(110), + 1412: uint16(111), + 1413: uint16(112), + 1414: uint16(113), + 1415: uint16(114), + 1416: uint16(36), + 1417: uint16(64), + 1418: uint16(145), + 1419: uint16(218), + 1420: uint16(219), 1421: uint16(218), - 1422: uint16(266), - 1423: uint16(265), - 1424: uint16(85), - 1425: uint16(106), - 1426: uint16(107), - 1427: uint16(256), - 1428: uint16(312), - 1429: uint16(90), - 1430: uint16(209), - 1431: uint16(210), - 1432: uint16(316), - 1433: uint16(114), - 1434: uint16(60), - 1435: uint16(116), - 1436: uint16(117), - 1437: uint16(118), - 1438: uint16(194), - 1439: uint16(100), - 1440: uint16(121), - 1441: uint16(194), - 1442: uint16(194), - 1443: uint16(145), - 1444: uint16(115), - 1445: uint16(106), - 1446: uint16(107), - 1447: uint16(19), - 1448: uint16(46), - 1449: uint16(19), - 1450: uint16(20), - 1451: uint16(24), - 1452: uint16(22), - 1453: uint16(114), - 1454: uint16(194), - 1455: uint16(116), - 1456: uint16(117), - 1457: uint16(118), - 1458: uint16(194), - 1459: uint16(245), - 1460: uint16(121), - 1461: uint16(194), - 1462: uint16(164), - 1463: uint16(194), - 1464: uint16(217), - 1465: uint16(218), - 1466: uint16(36), - 1467: uint16(194), - 1468: uint16(258), - 1469: uint16(259), - 1470: uint16(256), - 1471: uint16(194), - 1472: uint16(153), - 1473: uint16(154), - 1474: uint16(155), - 1475: uint16(156), - 1476: uint16(157), - 1477: uint16(217), - 1478: uint16(218), - 1479: uint16(150), - 1480: uint16(31), - 1481: uint16(217), - 1482: uint16(218), - 1483: uint16(142), - 1484: uint16(217), - 1485: uint16(218), - 1486: uint16(217), - 1487: uint16(218), - 1488: uint16(39), - 1489: uint16(59), - 1490: uint16(217), - 1491: uint16(218), - 1492: uint16(153), - 1493: uint16(154), - 1494: uint16(155), - 1495: uint16(156), - 1496: uint16(157), - 1497: uint16(149), - 1498: uint16(150), - 1499: uint16(5), - 1500: uint16(145), - 1501: uint16(71), - 1502: uint16(183), - 1503: uint16(245), - 1504: uint16(10), - 1505: uint16(11), - 1506: uint16(12), - 1507: uint16(13), - 1508: uint16(14), - 1509: uint16(194), - 1510: uint16(116), - 1511: uint16(17), - 1512: uint16(129), - 1513: uint16(227), - 1514: uint16(256), - 1515: uint16(85), - 1516: uint16(194), - 1517: uint16(115), - 1518: uint16(194), - 1519: uint16(23), - 1520: uint16(90), - 1521: uint16(25), - 1522: uint16(183), - 1523: uint16(99), - 1524: uint16(30), - 1525: uint16(97), - 1526: uint16(32), - 1527: uint16(22), - 1528: uint16(22), - 1529: uint16(194), - 1530: uint16(100), - 1531: uint16(194), - 1532: uint16(217), - 1533: uint16(218), - 1534: uint16(40), - 1535: uint16(152), - 1536: uint16(106), - 1537: uint16(107), - 1538: uint16(23), - 1539: uint16(217), + 1422: uint16(219), + 1423: uint16(195), + 1424: uint16(103), + 1425: uint16(104), + 1426: uint16(105), + 1427: uint16(106), + 1428: uint16(107), + 1429: uint16(108), + 1430: uint16(109), + 1431: uint16(110), + 1432: uint16(111), + 1433: uint16(112), + 1434: uint16(113), + 1435: uint16(114), + 1436: uint16(195), + 1437: uint16(154), + 1438: uint16(119), + 1439: uint16(156), + 1440: uint16(60), + 1441: uint16(189), + 1442: uint16(190), + 1443: uint16(191), + 1444: uint16(192), + 1445: uint16(195), + 1446: uint16(218), + 1447: uint16(219), + 1448: uint16(195), + 1449: uint16(197), + 1450: uint16(195), + 1451: uint16(199), + 1452: uint16(72), + 1453: uint16(195), + 1454: uint16(19), + 1455: uint16(78), + 1456: uint16(195), + 1457: uint16(80), + 1458: uint16(206), + 1459: uint16(218), + 1460: uint16(219), + 1461: uint16(195), + 1462: uint16(82), + 1463: uint16(144), + 1464: uint16(210), + 1465: uint16(211), + 1466: uint16(195), + 1467: uint16(15), + 1468: uint16(218), + 1469: uint16(219), + 1470: uint16(47), + 1471: uint16(218), + 1472: uint16(219), + 1473: uint16(218), + 1474: uint16(219), + 1475: uint16(259), + 1476: uint16(260), + 1477: uint16(195), + 1478: uint16(261), + 1479: uint16(218), + 1480: uint16(219), + 1481: uint16(101), + 1482: uint16(302), + 1483: uint16(303), + 1484: uint16(218), + 1485: uint16(219), + 1486: uint16(195), + 1487: uint16(107), + 1488: uint16(108), + 1489: uint16(218), + 1490: uint16(219), + 1491: uint16(150), + 1492: uint16(151), + 1493: uint16(241), + 1494: uint16(242), + 1495: uint16(115), + 1496: uint16(25), + 1497: uint16(117), + 1498: uint16(118), + 1499: uint16(119), + 1500: uint16(218), + 1501: uint16(219), + 1502: uint16(122), + 1503: uint16(195), + 1504: uint16(146), + 1505: uint16(195), + 1506: uint16(254), + 1507: uint16(195), + 1508: uint16(256), + 1509: uint16(218), + 1510: uint16(219), + 1511: uint16(246), + 1512: uint16(25), + 1513: uint16(61), + 1514: uint16(246), + 1515: uint16(19), + 1516: uint16(20), + 1517: uint16(195), + 1518: uint16(22), + 1519: uint16(139), + 1520: uint16(140), + 1521: uint16(269), + 1522: uint16(257), + 1523: uint16(195), + 1524: uint16(266), + 1525: uint16(257), + 1526: uint16(218), + 1527: uint16(219), + 1528: uint16(218), + 1529: uint16(219), + 1530: uint16(218), + 1531: uint16(219), + 1532: uint16(36), + 1533: uint16(246), + 1534: uint16(154), + 1535: uint16(155), + 1536: uint16(156), + 1537: uint16(157), + 1538: uint16(158), + 1539: uint16(116), 1540: uint16(218), - 1541: uint16(194), - 1542: uint16(19), - 1543: uint16(20), - 1544: uint16(114), - 1545: uint16(22), - 1546: uint16(116), - 1547: uint16(117), - 1548: uint16(118), - 1549: uint16(257), - 1550: uint16(194), - 1551: uint16(121), - 1552: uint16(217), - 1553: uint16(218), - 1554: uint16(217), - 1555: uint16(218), - 1556: uint16(194), - 1557: uint16(133), - 1558: uint16(53), - 1559: uint16(36), - 1560: uint16(23), - 1561: uint16(23), - 1562: uint16(25), - 1563: uint16(25), - 1564: uint16(70), - 1565: uint16(120), - 1566: uint16(121), - 1567: uint16(61), - 1568: uint16(141), - 1569: uint16(7), - 1570: uint16(8), - 1571: uint16(121), - 1572: uint16(78), - 1573: uint16(217), + 1541: uint16(219), + 1542: uint16(195), + 1543: uint16(22), + 1544: uint16(257), + 1545: uint16(49), + 1546: uint16(218), + 1547: uint16(219), + 1548: uint16(23), + 1549: uint16(195), + 1550: uint16(25), + 1551: uint16(195), + 1552: uint16(117), + 1553: uint16(301), + 1554: uint16(195), + 1555: uint16(25), + 1556: uint16(60), + 1557: uint16(195), + 1558: uint16(195), + 1559: uint16(23), + 1560: uint16(195), + 1561: uint16(25), + 1562: uint16(195), + 1563: uint16(183), + 1564: uint16(24), + 1565: uint16(218), + 1566: uint16(219), + 1567: uint16(130), + 1568: uint16(72), + 1569: uint16(195), + 1570: uint16(22), + 1571: uint16(195), + 1572: uint16(218), + 1573: uint16(219), 1574: uint16(218), - 1575: uint16(81), - 1576: uint16(23), - 1577: uint16(227), - 1578: uint16(25), - 1579: uint16(217), + 1575: uint16(219), + 1576: uint16(195), + 1577: uint16(218), + 1578: uint16(219), + 1579: uint16(195), 1580: uint16(218), - 1581: uint16(131), - 1582: uint16(59), - 1583: uint16(153), - 1584: uint16(154), - 1585: uint16(155), - 1586: uint16(156), - 1587: uint16(157), - 1589: uint16(1), - 1590: uint16(2), - 1591: uint16(59), - 1592: uint16(98), - 1593: uint16(5), - 1594: uint16(71), - 1595: uint16(23), - 1596: uint16(227), - 1597: uint16(25), - 1598: uint16(10), - 1599: uint16(11), - 1600: uint16(12), - 1601: uint16(13), - 1602: uint16(14), - 1603: uint16(83), - 1604: uint16(84), - 1605: uint16(17), + 1581: uint16(219), + 1582: uint16(86), + 1583: uint16(218), + 1584: uint16(219), + 1585: uint16(218), + 1586: uint16(219), + 1587: uint16(91), + 1588: uint16(19), + 1589: uint16(20), + 1590: uint16(153), + 1591: uint16(22), + 1592: uint16(218), + 1593: uint16(219), + 1594: uint16(218), + 1595: uint16(219), + 1596: uint16(195), + 1597: uint16(101), + 1598: uint16(195), + 1599: uint16(218), + 1600: uint16(219), + 1601: uint16(195), + 1602: uint16(195), + 1603: uint16(107), + 1604: uint16(108), + 1605: uint16(36), 1606: uint16(23), - 1607: uint16(23), + 1607: uint16(195), 1608: uint16(25), - 1609: uint16(25), - 1610: uint16(59), - 1611: uint16(194), - 1612: uint16(194), - 1613: uint16(183), - 1614: uint16(23), - 1615: uint16(23), - 1616: uint16(25), - 1617: uint16(25), - 1618: uint16(30), - 1619: uint16(194), - 1620: uint16(32), - 1621: uint16(19), - 1622: uint16(20), - 1623: uint16(100), - 1624: uint16(22), - 1625: uint16(194), - 1626: uint16(194), - 1627: uint16(133), - 1628: uint16(40), - 1629: uint16(106), - 1630: uint16(107), - 1631: uint16(108), - 1632: uint16(138), - 1633: uint16(139), - 1634: uint16(194), - 1635: uint16(217), - 1636: uint16(218), - 1637: uint16(114), - 1638: uint16(36), - 1639: uint16(116), - 1640: uint16(117), - 1641: uint16(118), - 1642: uint16(217), - 1643: uint16(218), - 1644: uint16(121), - 1645: uint16(194), - 1646: uint16(194), - 1647: uint16(194), - 1648: uint16(23), - 1649: uint16(117), - 1650: uint16(25), - 1651: uint16(194), - 1652: uint16(23), - 1653: uint16(23), - 1654: uint16(25), - 1655: uint16(25), - 1656: uint16(162), - 1657: uint16(194), - 1658: uint16(70), - 1659: uint16(194), - 1660: uint16(145), - 1661: uint16(59), - 1662: uint16(23), - 1663: uint16(153), - 1664: uint16(25), - 1665: uint16(155), - 1666: uint16(78), - 1667: uint16(194), - 1668: uint16(117), - 1669: uint16(81), - 1670: uint16(217), + 1609: uint16(195), + 1610: uint16(62), + 1611: uint16(115), + 1612: uint16(195), + 1613: uint16(117), + 1614: uint16(118), + 1615: uint16(119), + 1616: uint16(195), + 1617: uint16(146), + 1618: uint16(122), + 1619: uint16(218), + 1620: uint16(219), + 1621: uint16(218), + 1622: uint16(219), + 1623: uint16(195), + 1624: uint16(218), + 1625: uint16(219), + 1626: uint16(19), + 1627: uint16(60), + 1628: uint16(122), + 1629: uint16(60), + 1630: uint16(218), + 1631: uint16(219), + 1632: uint16(218), + 1633: uint16(219), + 1634: uint16(195), + 1635: uint16(218), + 1636: uint16(219), + 1637: uint16(150), + 1638: uint16(132), + 1639: uint16(218), + 1640: uint16(219), + 1641: uint16(72), + 1642: uint16(195), + 1643: uint16(23), + 1644: uint16(195), + 1645: uint16(25), + 1646: uint16(218), + 1647: uint16(219), + 1648: uint16(195), + 1649: uint16(60), + 1650: uint16(154), + 1651: uint16(155), + 1652: uint16(156), + 1653: uint16(157), + 1654: uint16(158), + 1655: uint16(86), + 1656: uint16(23), + 1657: uint16(195), + 1658: uint16(25), + 1659: uint16(195), + 1660: uint16(91), + 1661: uint16(19), + 1662: uint16(20), + 1663: uint16(142), + 1664: uint16(22), + 1665: uint16(218), + 1666: uint16(219), + 1667: uint16(218), + 1668: uint16(219), + 1669: uint16(130), + 1670: uint16(101), 1671: uint16(218), - 1672: uint16(194), - 1673: uint16(71), - 1674: uint16(217), - 1675: uint16(218), - 1676: uint16(153), - 1677: uint16(154), - 1678: uint16(155), - 1679: uint16(156), - 1680: uint16(157), - 1681: uint16(194), - 1682: uint16(217), - 1683: uint16(218), - 1684: uint16(194), - 1685: uint16(23), - 1686: uint16(98), - 1687: uint16(25), - 1688: uint16(321), - 1689: uint16(194), - 1690: uint16(217), - 1691: uint16(218), - 1692: uint16(194), - 1693: uint16(19), - 1694: uint16(20), - 1695: uint16(194), - 1696: uint16(22), - 1697: uint16(153), + 1672: uint16(219), + 1673: uint16(143), + 1674: uint16(121), + 1675: uint16(122), + 1676: uint16(107), + 1677: uint16(108), + 1678: uint16(36), + 1679: uint16(183), + 1680: uint16(218), + 1681: uint16(219), + 1682: uint16(142), + 1683: uint16(60), + 1684: uint16(115), + 1685: uint16(118), + 1686: uint16(117), + 1687: uint16(118), + 1688: uint16(119), + 1689: uint16(7), + 1690: uint16(8), + 1691: uint16(122), + 1692: uint16(153), + 1693: uint16(23), + 1694: uint16(23), + 1695: uint16(25), + 1696: uint16(25), + 1697: uint16(23), 1698: uint16(23), - 1699: uint16(155), + 1699: uint16(25), 1700: uint16(25), - 1701: uint16(194), - 1702: uint16(100), - 1703: uint16(194), - 1704: uint16(217), - 1705: uint16(218), - 1706: uint16(183), - 1707: uint16(194), - 1708: uint16(106), - 1709: uint16(107), - 1710: uint16(36), - 1711: uint16(194), - 1712: uint16(217), - 1713: uint16(218), - 1714: uint16(237), - 1715: uint16(194), - 1716: uint16(114), - 1717: uint16(243), - 1718: uint16(116), - 1719: uint16(117), - 1720: uint16(118), - 1721: uint16(133), - 1722: uint16(194), - 1723: uint16(121), - 1724: uint16(217), - 1725: uint16(218), - 1726: uint16(138), - 1727: uint16(139), - 1728: uint16(194), - 1729: uint16(194), - 1730: uint16(194), - 1731: uint16(290), - 1732: uint16(289), - 1733: uint16(59), - 1734: uint16(217), - 1735: uint16(218), - 1736: uint16(194), - 1737: uint16(194), - 1738: uint16(217), - 1739: uint16(218), - 1740: uint16(194), - 1741: uint16(194), - 1742: uint16(140), - 1743: uint16(194), - 1744: uint16(194), - 1745: uint16(71), - 1746: uint16(194), - 1747: uint16(244), - 1748: uint16(194), - 1749: uint16(194), - 1750: uint16(162), - 1751: uint16(217), - 1752: uint16(218), - 1753: uint16(194), - 1754: uint16(194), - 1755: uint16(153), - 1756: uint16(154), - 1757: uint16(155), - 1758: uint16(156), - 1759: uint16(157), - 1760: uint16(217), - 1761: uint16(218), - 1762: uint16(194), - 1763: uint16(217), - 1764: uint16(218), - 1765: uint16(194), - 1766: uint16(217), - 1767: uint16(218), - 1768: uint16(257), - 1769: uint16(217), - 1770: uint16(218), - 1771: uint16(217), - 1772: uint16(218), - 1773: uint16(257), - 1774: uint16(100), - 1775: uint16(194), - 1776: uint16(257), - 1777: uint16(217), - 1778: uint16(218), - 1779: uint16(257), - 1780: uint16(106), - 1781: uint16(107), - 1782: uint16(215), - 1783: uint16(299), - 1784: uint16(194), - 1785: uint16(183), - 1786: uint16(192), - 1787: uint16(194), - 1788: uint16(114), - 1789: uint16(194), - 1790: uint16(116), - 1791: uint16(117), - 1792: uint16(118), - 1793: uint16(1), - 1794: uint16(2), - 1795: uint16(121), - 1796: uint16(221), - 1797: uint16(5), - 1798: uint16(217), - 1799: uint16(218), - 1800: uint16(273), - 1801: uint16(197), - 1802: uint16(10), - 1803: uint16(11), - 1804: uint16(12), - 1805: uint16(13), - 1806: uint16(14), - 1807: uint16(217), - 1808: uint16(218), - 1809: uint16(17), - 1810: uint16(217), - 1811: uint16(218), - 1812: uint16(217), - 1813: uint16(218), - 1814: uint16(140), - 1815: uint16(194), - 1816: uint16(246), - 1817: uint16(194), - 1818: uint16(273), - 1819: uint16(295), - 1820: uint16(247), - 1821: uint16(273), - 1822: uint16(30), - 1823: uint16(247), - 1824: uint16(32), - 1825: uint16(269), - 1826: uint16(269), - 1827: uint16(153), - 1828: uint16(154), - 1829: uint16(155), - 1830: uint16(156), - 1831: uint16(157), - 1832: uint16(40), - 1833: uint16(246), - 1834: uint16(273), - 1835: uint16(295), - 1836: uint16(230), - 1837: uint16(226), - 1838: uint16(217), - 1839: uint16(218), - 1840: uint16(217), - 1841: uint16(218), - 1842: uint16(220), - 1843: uint16(261), - 1844: uint16(220), - 1845: uint16(282), - 1846: uint16(220), - 1847: uint16(19), - 1848: uint16(20), - 1849: uint16(244), - 1850: uint16(22), - 1851: uint16(250), - 1852: uint16(141), - 1853: uint16(250), - 1854: uint16(246), - 1855: uint16(60), - 1856: uint16(201), - 1857: uint16(183), - 1858: uint16(261), - 1859: uint16(261), - 1860: uint16(261), - 1861: uint16(201), - 1862: uint16(70), - 1863: uint16(299), - 1864: uint16(36), - 1865: uint16(299), - 1866: uint16(201), - 1867: uint16(38), - 1868: uint16(151), - 1869: uint16(150), - 1870: uint16(78), - 1871: uint16(285), - 1872: uint16(22), - 1873: uint16(81), - 1874: uint16(296), - 1875: uint16(296), - 1876: uint16(43), - 1877: uint16(235), - 1878: uint16(18), - 1879: uint16(238), - 1880: uint16(201), - 1881: uint16(274), - 1882: uint16(272), - 1883: uint16(238), - 1884: uint16(238), - 1885: uint16(238), - 1886: uint16(18), - 1887: uint16(59), - 1888: uint16(200), - 1889: uint16(149), - 1890: uint16(98), - 1891: uint16(247), - 1892: uint16(274), - 1893: uint16(274), - 1894: uint16(235), - 1895: uint16(247), - 1896: uint16(247), - 1897: uint16(247), - 1898: uint16(235), - 1899: uint16(71), - 1900: uint16(272), - 1901: uint16(201), - 1902: uint16(200), - 1903: uint16(158), - 1904: uint16(292), - 1905: uint16(62), - 1906: uint16(291), - 1907: uint16(201), - 1908: uint16(200), - 1909: uint16(22), - 1910: uint16(201), - 1911: uint16(222), - 1912: uint16(200), - 1913: uint16(222), - 1914: uint16(201), - 1915: uint16(200), - 1916: uint16(115), - 1917: uint16(219), - 1918: uint16(219), - 1919: uint16(64), - 1920: uint16(219), - 1921: uint16(228), - 1922: uint16(22), - 1923: uint16(126), - 1924: uint16(221), - 1925: uint16(133), - 1926: uint16(165), - 1927: uint16(222), - 1928: uint16(100), - 1929: uint16(225), - 1930: uint16(138), - 1931: uint16(139), - 1932: uint16(225), - 1933: uint16(219), - 1934: uint16(106), - 1935: uint16(107), - 1936: uint16(24), - 1937: uint16(219), - 1938: uint16(228), - 1939: uint16(219), - 1940: uint16(219), - 1941: uint16(307), - 1942: uint16(114), - 1943: uint16(113), - 1944: uint16(116), - 1945: uint16(117), - 1946: uint16(118), - 1947: uint16(315), - 1948: uint16(284), - 1949: uint16(121), - 1950: uint16(284), - 1951: uint16(222), - 1952: uint16(201), - 1953: uint16(91), - 1954: uint16(162), - 1955: uint16(320), - 1956: uint16(320), - 1957: uint16(82), - 1958: uint16(148), - 1959: uint16(267), - 1960: uint16(145), - 1961: uint16(267), - 1962: uint16(22), - 1963: uint16(279), - 1964: uint16(201), - 1965: uint16(158), - 1966: uint16(281), - 1967: uint16(251), - 1968: uint16(147), - 1969: uint16(146), - 1970: uint16(25), - 1971: uint16(203), - 1972: uint16(250), - 1973: uint16(249), - 1974: uint16(251), - 1975: uint16(248), - 1976: uint16(13), - 1977: uint16(247), - 1978: uint16(195), - 1979: uint16(195), - 1980: uint16(6), - 1981: uint16(153), - 1982: uint16(154), - 1983: uint16(155), - 1984: uint16(156), - 1985: uint16(157), - 1986: uint16(193), - 1987: uint16(193), - 1988: uint16(305), - 1989: uint16(193), - 1990: uint16(208), - 1991: uint16(305), - 1992: uint16(302), - 1993: uint16(214), - 1994: uint16(214), - 1995: uint16(214), - 1996: uint16(208), - 1997: uint16(223), - 1998: uint16(223), - 1999: uint16(214), - 2000: uint16(4), - 2001: uint16(215), - 2002: uint16(215), - 2003: uint16(214), - 2004: uint16(3), - 2005: uint16(22), - 2006: uint16(208), - 2007: uint16(163), - 2008: uint16(15), - 2009: uint16(23), - 2010: uint16(16), - 2011: uint16(183), - 2012: uint16(23), - 2013: uint16(139), - 2014: uint16(151), - 2015: uint16(130), - 2016: uint16(25), - 2017: uint16(20), - 2018: uint16(142), - 2019: uint16(24), - 2020: uint16(16), - 2021: uint16(144), - 2022: uint16(1), - 2023: uint16(142), - 2024: uint16(130), - 2025: uint16(130), - 2026: uint16(61), - 2027: uint16(37), - 2028: uint16(53), - 2029: uint16(151), - 2030: uint16(53), - 2031: uint16(53), - 2032: uint16(53), - 2033: uint16(130), - 2034: uint16(116), - 2035: uint16(1), - 2036: uint16(34), - 2037: uint16(141), - 2038: uint16(5), - 2039: uint16(22), - 2040: uint16(115), - 2041: uint16(161), - 2042: uint16(75), - 2043: uint16(25), - 2044: uint16(68), - 2045: uint16(141), - 2046: uint16(41), - 2047: uint16(115), - 2048: uint16(68), - 2049: uint16(24), - 2050: uint16(20), - 2051: uint16(19), - 2052: uint16(131), - 2053: uint16(125), - 2054: uint16(67), - 2055: uint16(67), - 2056: uint16(96), - 2057: uint16(22), + 1701: uint16(23), + 1702: uint16(60), + 1703: uint16(25), + 1704: uint16(23), + 1705: uint16(98), + 1706: uint16(25), + 1707: uint16(118), + 1708: uint16(84), + 1709: uint16(85), + 1710: uint16(23), + 1711: uint16(23), + 1712: uint16(25), + 1713: uint16(25), + 1714: uint16(72), + 1715: uint16(154), + 1716: uint16(23), + 1717: uint16(156), + 1718: uint16(25), + 1719: uint16(23), + 1720: uint16(228), + 1721: uint16(25), + 1722: uint16(195), + 1723: uint16(154), + 1724: uint16(155), + 1725: uint16(156), + 1726: uint16(157), + 1727: uint16(158), + 1728: uint16(86), + 1729: uint16(195), + 1730: uint16(195), + 1731: uint16(258), + 1732: uint16(195), + 1733: uint16(91), + 1734: uint16(291), + 1735: uint16(322), + 1736: uint16(195), + 1737: uint16(195), + 1738: uint16(195), + 1739: uint16(195), + 1740: uint16(195), + 1741: uint16(118), + 1742: uint16(195), + 1743: uint16(101), + 1744: uint16(195), + 1745: uint16(195), + 1746: uint16(195), + 1747: uint16(195), + 1748: uint16(238), + 1749: uint16(107), + 1750: uint16(108), + 1751: uint16(195), + 1752: uint16(183), + 1753: uint16(195), + 1754: uint16(195), + 1755: uint16(195), + 1756: uint16(290), + 1757: uint16(115), + 1758: uint16(195), + 1759: uint16(117), + 1760: uint16(118), + 1761: uint16(119), + 1762: uint16(244), + 1763: uint16(195), + 1764: uint16(122), + 1765: uint16(195), + 1766: uint16(195), + 1767: uint16(195), + 1768: uint16(195), + 1769: uint16(195), + 1770: uint16(195), + 1771: uint16(258), + 1772: uint16(258), + 1773: uint16(258), + 1774: uint16(258), + 1775: uint16(193), + 1776: uint16(245), + 1777: uint16(300), + 1778: uint16(216), + 1779: uint16(274), + 1780: uint16(247), + 1781: uint16(270), + 1782: uint16(270), + 1783: uint16(274), + 1784: uint16(296), + 1785: uint16(296), + 1786: uint16(248), + 1787: uint16(222), + 1788: uint16(262), + 1789: uint16(198), + 1790: uint16(262), + 1791: uint16(274), + 1792: uint16(61), + 1793: uint16(274), + 1794: uint16(248), + 1795: uint16(231), + 1796: uint16(154), + 1797: uint16(155), + 1798: uint16(156), + 1799: uint16(157), + 1800: uint16(158), + 1802: uint16(1), + 1803: uint16(2), + 1804: uint16(247), + 1805: uint16(227), + 1806: uint16(5), + 1807: uint16(221), + 1808: uint16(221), + 1809: uint16(221), + 1810: uint16(142), + 1811: uint16(10), + 1812: uint16(11), + 1813: uint16(12), + 1814: uint16(13), + 1815: uint16(14), + 1816: uint16(262), + 1817: uint16(262), + 1818: uint16(17), + 1819: uint16(202), + 1820: uint16(300), + 1821: uint16(19), + 1822: uint16(20), + 1823: uint16(300), + 1824: uint16(22), + 1825: uint16(183), + 1826: uint16(247), + 1827: uint16(251), + 1828: uint16(251), + 1829: uint16(245), + 1830: uint16(202), + 1831: uint16(30), + 1832: uint16(38), + 1833: uint16(32), + 1834: uint16(202), + 1835: uint16(152), + 1836: uint16(151), + 1837: uint16(22), + 1838: uint16(36), + 1839: uint16(43), + 1840: uint16(236), + 1841: uint16(40), + 1842: uint16(18), + 1843: uint16(202), + 1844: uint16(239), + 1845: uint16(239), + 1846: uint16(18), + 1847: uint16(239), + 1848: uint16(239), + 1849: uint16(283), + 1850: uint16(201), + 1851: uint16(150), + 1852: uint16(236), + 1853: uint16(202), + 1854: uint16(236), + 1855: uint16(201), + 1856: uint16(159), + 1857: uint16(202), + 1858: uint16(248), + 1859: uint16(248), + 1860: uint16(248), + 1861: uint16(248), + 1862: uint16(60), + 1863: uint16(63), + 1864: uint16(201), + 1865: uint16(275), + 1866: uint16(273), + 1867: uint16(275), + 1868: uint16(273), + 1869: uint16(275), + 1870: uint16(22), + 1871: uint16(286), + 1872: uint16(71), + 1873: uint16(223), + 1874: uint16(72), + 1875: uint16(202), + 1876: uint16(223), + 1877: uint16(297), + 1878: uint16(297), + 1879: uint16(202), + 1880: uint16(79), + 1881: uint16(201), + 1882: uint16(116), + 1883: uint16(82), + 1884: uint16(220), + 1885: uint16(201), + 1886: uint16(220), + 1887: uint16(220), + 1888: uint16(65), + 1889: uint16(293), + 1890: uint16(292), + 1891: uint16(229), + 1892: uint16(22), + 1893: uint16(166), + 1894: uint16(127), + 1895: uint16(226), + 1896: uint16(24), + 1897: uint16(114), + 1898: uint16(226), + 1899: uint16(223), + 1900: uint16(99), + 1901: uint16(222), + 1902: uint16(202), + 1903: uint16(101), + 1904: uint16(285), + 1905: uint16(92), + 1906: uint16(220), + 1907: uint16(308), + 1908: uint16(83), + 1909: uint16(107), + 1910: uint16(108), + 1911: uint16(220), + 1912: uint16(220), + 1913: uint16(316), + 1914: uint16(220), + 1915: uint16(285), + 1916: uint16(268), + 1917: uint16(115), + 1918: uint16(229), + 1919: uint16(117), + 1920: uint16(118), + 1921: uint16(119), + 1922: uint16(223), + 1923: uint16(321), + 1924: uint16(122), + 1925: uint16(268), + 1926: uint16(149), + 1927: uint16(146), + 1928: uint16(22), + 1929: uint16(19), + 1930: uint16(20), + 1931: uint16(202), + 1932: uint16(22), + 1933: uint16(159), + 1934: uint16(282), + 1935: uint16(134), + 1936: uint16(321), + 1937: uint16(148), + 1938: uint16(280), + 1939: uint16(147), + 1940: uint16(139), + 1941: uint16(140), + 1942: uint16(252), + 1943: uint16(141), + 1944: uint16(25), + 1945: uint16(204), + 1946: uint16(36), + 1947: uint16(252), + 1948: uint16(13), + 1949: uint16(251), + 1950: uint16(196), + 1951: uint16(248), + 1952: uint16(250), + 1953: uint16(249), + 1954: uint16(196), + 1955: uint16(6), + 1956: uint16(154), + 1957: uint16(155), + 1958: uint16(156), + 1959: uint16(157), + 1960: uint16(158), + 1961: uint16(209), + 1962: uint16(194), + 1963: uint16(194), + 1964: uint16(163), + 1965: uint16(194), + 1966: uint16(306), + 1967: uint16(306), + 1968: uint16(303), + 1969: uint16(224), + 1970: uint16(60), + 1971: uint16(215), + 1972: uint16(215), + 1973: uint16(209), + 1974: uint16(215), + 1975: uint16(215), + 1976: uint16(215), + 1977: uint16(224), + 1978: uint16(216), + 1979: uint16(216), + 1980: uint16(4), + 1981: uint16(209), + 1982: uint16(72), + 1983: uint16(3), + 1984: uint16(22), + 1985: uint16(183), + 1986: uint16(164), + 1987: uint16(15), + 1988: uint16(23), + 1989: uint16(16), + 1990: uint16(23), + 1991: uint16(140), + 1992: uint16(152), + 1993: uint16(131), + 1994: uint16(25), + 1995: uint16(24), + 1996: uint16(143), + 1997: uint16(20), + 1998: uint16(16), + 1999: uint16(145), + 2000: uint16(1), + 2001: uint16(143), + 2002: uint16(131), + 2003: uint16(62), + 2004: uint16(131), + 2005: uint16(37), + 2006: uint16(54), + 2007: uint16(152), + 2008: uint16(54), + 2009: uint16(54), + 2010: uint16(54), + 2011: uint16(101), + 2012: uint16(131), + 2013: uint16(117), + 2014: uint16(1), + 2015: uint16(34), + 2016: uint16(142), + 2017: uint16(107), + 2018: uint16(108), + 2019: uint16(5), + 2020: uint16(22), + 2021: uint16(116), + 2022: uint16(162), + 2023: uint16(76), + 2024: uint16(41), + 2025: uint16(115), + 2026: uint16(69), + 2027: uint16(117), + 2028: uint16(118), + 2029: uint16(119), + 2030: uint16(1), + 2031: uint16(2), + 2032: uint16(122), + 2033: uint16(25), + 2034: uint16(5), + 2035: uint16(69), + 2036: uint16(142), + 2037: uint16(116), + 2038: uint16(20), + 2039: uint16(10), + 2040: uint16(11), + 2041: uint16(12), + 2042: uint16(13), + 2043: uint16(14), + 2044: uint16(24), + 2045: uint16(19), + 2046: uint16(17), + 2047: uint16(132), + 2048: uint16(5), + 2049: uint16(126), + 2050: uint16(22), + 2051: uint16(141), + 2052: uint16(68), + 2053: uint16(10), + 2054: uint16(11), + 2055: uint16(12), + 2056: uint16(13), + 2057: uint16(14), 2058: uint16(22), - 2059: uint16(22), - 2060: uint16(37), - 2061: uint16(23), + 2059: uint16(30), + 2060: uint16(17), + 2061: uint16(32), 2062: uint16(22), - 2063: uint16(24), - 2064: uint16(22), - 2065: uint16(59), - 2066: uint16(67), - 2067: uint16(23), - 2068: uint16(149), - 2069: uint16(28), - 2070: uint16(22), - 2071: uint16(25), - 2072: uint16(23), - 2073: uint16(23), - 2074: uint16(23), - 2075: uint16(22), - 2076: uint16(141), - 2077: uint16(34), - 2078: uint16(97), - 2079: uint16(23), + 2063: uint16(22), + 2064: uint16(154), + 2065: uint16(155), + 2066: uint16(156), + 2067: uint16(157), + 2068: uint16(158), + 2069: uint16(40), + 2070: uint16(23), + 2071: uint16(68), + 2072: uint16(60), + 2073: uint16(30), + 2074: uint16(24), + 2075: uint16(32), + 2076: uint16(97), + 2077: uint16(28), + 2078: uint16(22), + 2079: uint16(68), 2080: uint16(23), - 2081: uint16(34), - 2082: uint16(116), - 2083: uint16(22), - 2084: uint16(143), - 2085: uint16(25), - 2086: uint16(34), - 2087: uint16(75), - 2088: uint16(34), - 2089: uint16(34), - 2090: uint16(75), - 2091: uint16(88), - 2092: uint16(34), - 2093: uint16(86), + 2081: uint16(37), + 2082: uint16(34), + 2083: uint16(40), + 2084: uint16(150), + 2085: uint16(22), + 2086: uint16(25), + 2087: uint16(23), + 2088: uint16(23), + 2089: uint16(23), + 2090: uint16(22), + 2091: uint16(98), + 2092: uint16(142), + 2093: uint16(183), 2094: uint16(23), - 2095: uint16(22), + 2095: uint16(23), 2096: uint16(34), - 2097: uint16(25), - 2098: uint16(24), - 2099: uint16(34), - 2100: uint16(25), - 2101: uint16(93), - 2102: uint16(23), - 2103: uint16(44), - 2104: uint16(142), - 2105: uint16(23), - 2106: uint16(142), - 2107: uint16(23), - 2108: uint16(23), - 2109: uint16(22), - 2110: uint16(11), - 2111: uint16(25), - 2112: uint16(23), - 2113: uint16(25), - 2114: uint16(23), - 2115: uint16(22), - 2116: uint16(22), - 2117: uint16(22), - 2118: uint16(1), - 2119: uint16(23), - 2120: uint16(23), - 2121: uint16(23), - 2122: uint16(22), - 2123: uint16(22), - 2124: uint16(15), - 2125: uint16(141), - 2126: uint16(141), - 2127: uint16(25), - 2128: uint16(25), - 2129: uint16(1), - 2130: uint16(322), - 2131: uint16(322), - 2132: uint16(322), - 2133: uint16(135), - 2134: uint16(322), - 2135: uint16(322), - 2136: uint16(322), - 2137: uint16(322), - 2138: uint16(322), - 2139: uint16(322), - 2140: uint16(322), - 2141: uint16(141), - 2142: uint16(322), - 2143: uint16(322), - 2144: uint16(322), - 2145: uint16(322), - 2146: uint16(322), - 2147: uint16(322), - 2148: uint16(322), - 2149: uint16(322), - 2150: uint16(322), - 2151: uint16(322), - 2152: uint16(322), - 2153: uint16(322), - 2154: uint16(322), - 2155: uint16(322), - 2156: uint16(322), - 2157: uint16(322), - 2158: uint16(322), - 2159: uint16(322), - 2160: uint16(322), - 2161: uint16(322), - 2162: uint16(322), - 2163: uint16(322), - 2164: uint16(322), - 2165: uint16(322), - 2166: uint16(322), - 2167: uint16(322), - 2168: uint16(322), - 2169: uint16(322), - 2170: uint16(322), - 2171: uint16(322), - 2172: uint16(322), - 2173: uint16(322), - 2174: uint16(322), - 2175: uint16(322), - 2176: uint16(322), - 2177: uint16(322), - 2178: uint16(322), - 2179: uint16(322), - 2180: uint16(322), - 2181: uint16(322), - 2182: uint16(322), - 2183: uint16(322), - 2184: uint16(322), - 2185: uint16(322), - 2186: uint16(322), - 2187: uint16(322), - 2188: uint16(322), - 2189: uint16(322), - 2190: uint16(322), - 2191: uint16(322), - 2192: uint16(322), - 2193: uint16(322), - 2194: uint16(322), - 2195: uint16(322), - 2196: uint16(322), - 2197: uint16(322), - 2198: uint16(322), - 2199: uint16(322), - 2200: uint16(322), - 2201: uint16(322), - 2202: uint16(322), - 2203: uint16(322), - 2204: uint16(322), - 2205: uint16(322), - 2206: uint16(322), - 2207: uint16(322), - 2208: uint16(322), - 2209: uint16(322), - 2210: uint16(322), - 2211: uint16(322), - 2212: uint16(322), - 2213: uint16(322), - 2214: uint16(322), - 2215: uint16(322), - 2216: uint16(322), - 2217: uint16(322), - 2218: uint16(322), - 2219: uint16(322), - 2220: uint16(322), - 2221: uint16(322), - 2222: uint16(322), - 2223: uint16(322), - 2224: uint16(322), - 2225: uint16(322), - 2226: uint16(322), - 2227: uint16(322), - 2228: uint16(322), - 2229: uint16(322), - 2230: uint16(322), - 2231: uint16(322), - 2232: uint16(322), - 2233: uint16(322), - 2234: uint16(322), - 2235: uint16(322), - 2236: uint16(322), - 2237: uint16(322), - 2238: uint16(322), - 2239: uint16(322), - 2240: uint16(322), - 2241: uint16(322), - 2242: uint16(322), - 2243: uint16(322), - 2244: uint16(322), - 2245: uint16(322), - 2246: uint16(322), - 2247: uint16(322), - 2248: uint16(322), - 2249: uint16(322), - 2250: uint16(322), - 2251: uint16(322), - 2252: uint16(322), - 2253: uint16(322), - 2254: uint16(322), - 2255: uint16(322), - 2256: uint16(322), - 2257: uint16(322), - 2258: uint16(322), - 2259: uint16(322), - 2260: uint16(322), - 2261: uint16(322), - 2262: uint16(322), - 2263: uint16(322), - 2264: uint16(322), - 2265: uint16(322), - 2266: uint16(322), - 2267: uint16(322), - 2268: uint16(322), - 2269: uint16(322), - 2270: uint16(322), - 2271: uint16(322), - 2272: uint16(322), - 2273: uint16(322), - 2274: uint16(322), - 2275: uint16(322), - 2276: uint16(322), - 2277: uint16(322), - 2278: uint16(322), - 2279: uint16(322), - 2280: uint16(322), - 2281: uint16(322), - 2282: uint16(322), - 2283: uint16(322), - 2284: uint16(322), - 2285: uint16(322), - 2286: uint16(322), - 2287: uint16(322), - 2288: uint16(322), - 2289: uint16(322), - 2290: uint16(322), - 2291: uint16(322), - 2292: uint16(322), - 2293: uint16(322), - 2294: uint16(322), - 2295: uint16(322), - 2296: uint16(322), - 2297: uint16(322), - 2298: uint16(322), - 2299: uint16(322), - 2300: uint16(322), - 2301: uint16(322), - 2302: uint16(322), - 2303: uint16(322), - 2304: uint16(322), - 2305: uint16(322), - 2306: uint16(322), - 2307: uint16(322), - 2308: uint16(322), - 2309: uint16(322), - 2310: uint16(322), - 2311: uint16(322), - 2312: uint16(322), - 2313: uint16(322), - 2314: uint16(322), - 2315: uint16(322), - 2316: uint16(322), - 2317: uint16(322), - 2318: uint16(322), - 2319: uint16(322), - 2320: uint16(322), - 2321: uint16(322), - 2322: uint16(322), - 2323: uint16(322), - 2324: uint16(322), - 2325: uint16(322), - 2326: uint16(322), - 2327: uint16(322), + 2097: uint16(22), + 2098: uint16(25), + 2099: uint16(89), + 2100: uint16(71), + 2101: uint16(34), + 2102: uint16(117), + 2103: uint16(144), + 2104: uint16(34), + 2105: uint16(22), + 2106: uint16(76), + 2107: uint16(76), + 2108: uint16(79), + 2109: uint16(87), + 2110: uint16(34), + 2111: uint16(82), + 2112: uint16(34), + 2113: uint16(44), + 2114: uint16(71), + 2115: uint16(94), + 2116: uint16(34), + 2117: uint16(23), + 2118: uint16(25), + 2119: uint16(24), + 2120: uint16(34), + 2121: uint16(25), + 2122: uint16(79), + 2123: uint16(23), + 2124: uint16(23), + 2125: uint16(82), + 2126: uint16(23), + 2127: uint16(23), + 2128: uint16(99), + 2129: uint16(143), + 2130: uint16(143), + 2131: uint16(22), + 2132: uint16(25), + 2133: uint16(25), + 2134: uint16(23), + 2135: uint16(22), + 2136: uint16(11), + 2137: uint16(22), + 2138: uint16(22), + 2139: uint16(25), + 2140: uint16(23), + 2141: uint16(23), + 2142: uint16(99), + 2143: uint16(22), + 2144: uint16(22), + 2145: uint16(136), + 2146: uint16(142), + 2147: uint16(142), + 2148: uint16(142), + 2149: uint16(25), + 2150: uint16(23), + 2151: uint16(15), + 2152: uint16(1), + 2153: uint16(1), + 2154: uint16(323), + 2155: uint16(323), + 2156: uint16(323), + 2157: uint16(323), + 2158: uint16(323), + 2159: uint16(323), + 2160: uint16(323), + 2161: uint16(323), + 2162: uint16(323), + 2163: uint16(134), + 2164: uint16(323), + 2165: uint16(323), + 2166: uint16(323), + 2167: uint16(323), + 2168: uint16(139), + 2169: uint16(140), + 2170: uint16(323), + 2171: uint16(323), + 2172: uint16(323), + 2173: uint16(323), + 2174: uint16(323), + 2175: uint16(323), + 2176: uint16(323), + 2177: uint16(134), + 2178: uint16(323), + 2179: uint16(323), + 2180: uint16(323), + 2181: uint16(323), + 2182: uint16(139), + 2183: uint16(140), + 2184: uint16(323), + 2185: uint16(323), + 2186: uint16(323), + 2187: uint16(323), + 2188: uint16(323), + 2189: uint16(323), + 2190: uint16(323), + 2191: uint16(323), + 2192: uint16(163), + 2193: uint16(323), + 2194: uint16(323), + 2195: uint16(323), + 2196: uint16(323), + 2197: uint16(323), + 2198: uint16(323), + 2199: uint16(323), + 2200: uint16(323), + 2201: uint16(323), + 2202: uint16(323), + 2203: uint16(323), + 2204: uint16(323), + 2205: uint16(323), + 2206: uint16(163), + 2207: uint16(323), + 2208: uint16(323), + 2209: uint16(323), + 2210: uint16(323), + 2211: uint16(323), + 2212: uint16(323), + 2213: uint16(323), + 2214: uint16(323), + 2215: uint16(323), + 2216: uint16(323), + 2217: uint16(323), + 2218: uint16(323), + 2219: uint16(323), + 2220: uint16(323), + 2221: uint16(323), + 2222: uint16(323), + 2223: uint16(323), + 2224: uint16(323), + 2225: uint16(323), + 2226: uint16(323), + 2227: uint16(323), + 2228: uint16(323), + 2229: uint16(323), + 2230: uint16(323), + 2231: uint16(323), + 2232: uint16(323), + 2233: uint16(323), + 2234: uint16(323), + 2235: uint16(323), + 2236: uint16(323), + 2237: uint16(323), + 2238: uint16(323), + 2239: uint16(323), + 2240: uint16(323), + 2241: uint16(323), + 2242: uint16(323), + 2243: uint16(323), + 2244: uint16(323), + 2245: uint16(323), + 2246: uint16(323), + 2247: uint16(323), + 2248: uint16(323), + 2249: uint16(323), + 2250: uint16(323), + 2251: uint16(323), + 2252: uint16(323), + 2253: uint16(323), + 2254: uint16(323), + 2255: uint16(323), + 2256: uint16(323), + 2257: uint16(323), + 2258: uint16(323), + 2259: uint16(323), + 2260: uint16(323), + 2261: uint16(323), + 2262: uint16(323), + 2263: uint16(323), + 2264: uint16(323), + 2265: uint16(323), + 2266: uint16(323), + 2267: uint16(323), + 2268: uint16(323), + 2269: uint16(323), + 2270: uint16(323), + 2271: uint16(323), + 2272: uint16(323), + 2273: uint16(323), + 2274: uint16(323), + 2275: uint16(323), + 2276: uint16(323), + 2277: uint16(323), + 2278: uint16(323), + 2279: uint16(323), + 2280: uint16(323), + 2281: uint16(323), + 2282: uint16(323), + 2283: uint16(323), + 2284: uint16(323), + 2285: uint16(323), + 2286: uint16(323), + 2287: uint16(323), + 2288: uint16(323), + 2289: uint16(323), + 2290: uint16(323), + 2291: uint16(323), + 2292: uint16(323), + 2293: uint16(323), + 2294: uint16(323), + 2295: uint16(323), + 2296: uint16(323), + 2297: uint16(323), + 2298: uint16(323), + 2299: uint16(323), + 2300: uint16(323), + 2301: uint16(323), + 2302: uint16(323), + 2303: uint16(323), + 2304: uint16(323), + 2305: uint16(323), + 2306: uint16(323), + 2307: uint16(323), + 2308: uint16(323), + 2309: uint16(323), + 2310: uint16(323), + 2311: uint16(323), + 2312: uint16(323), + 2313: uint16(323), + 2314: uint16(323), + 2315: uint16(323), + 2316: uint16(323), + 2317: uint16(323), + 2318: uint16(323), + 2319: uint16(323), + 2320: uint16(323), + 2321: uint16(323), + 2322: uint16(323), + 2323: uint16(323), + 2324: uint16(323), + 2325: uint16(323), + 2326: uint16(323), + 2327: uint16(323), + 2328: uint16(323), + 2329: uint16(323), + 2330: uint16(323), + 2331: uint16(323), + 2332: uint16(323), + 2333: uint16(323), + 2334: uint16(323), + 2335: uint16(323), + 2336: uint16(323), + 2337: uint16(323), + 2338: uint16(323), + 2339: uint16(323), + 2340: uint16(323), + 2341: uint16(187), + 2342: uint16(187), + 2343: uint16(187), + 2344: uint16(187), + 2345: uint16(187), + 2346: uint16(187), + 2347: uint16(187), + 2348: uint16(187), + 2349: uint16(187), + 2350: uint16(187), + 2351: uint16(187), + 2352: uint16(187), + 2353: uint16(187), + 2354: uint16(187), + 2355: uint16(187), + 2356: uint16(187), + 2357: uint16(187), + 2358: uint16(187), + 2359: uint16(187), + 2360: uint16(187), + 2361: uint16(187), + 2362: uint16(187), + 2363: uint16(187), + 2364: uint16(187), + 2365: uint16(187), + 2366: uint16(187), + 2367: uint16(187), + 2368: uint16(187), + 2369: uint16(187), + 2370: uint16(187), + 2371: uint16(187), + 2372: uint16(187), + 2373: uint16(187), + 2374: uint16(187), + 2375: uint16(187), + 2376: uint16(187), + 2377: uint16(187), + 2378: uint16(187), + 2379: uint16(187), + 2380: uint16(187), + 2381: uint16(187), + 2382: uint16(187), + 2383: uint16(187), + 2384: uint16(187), + 2385: uint16(187), + 2386: uint16(187), + 2387: uint16(187), + 2388: uint16(187), + 2389: uint16(187), + 2390: uint16(187), + 2391: uint16(187), + 2392: uint16(187), + 2393: uint16(187), } var _yy_shift_ofst = [583]uint16{ - 0: uint16(1792), - 1: uint16(1588), - 2: uint16(1494), - 3: uint16(322), - 4: uint16(322), - 5: uint16(399), - 6: uint16(306), - 7: uint16(1319), - 8: uint16(1339), - 9: uint16(1430), - 10: uint16(1828), - 11: uint16(1828), - 12: uint16(1828), - 13: uint16(580), - 14: uint16(399), - 15: uint16(399), - 16: uint16(399), - 17: uint16(399), - 18: uint16(399), - 21: uint16(214), - 22: uint16(1093), - 23: uint16(1828), - 24: uint16(1828), - 25: uint16(1828), - 26: uint16(1828), - 27: uint16(1828), - 28: uint16(1828), - 29: uint16(1828), - 30: uint16(1828), - 31: uint16(1828), - 32: uint16(1828), - 33: uint16(1828), - 34: uint16(1828), - 35: uint16(1828), - 36: uint16(1828), - 37: uint16(1828), - 38: uint16(1130), - 39: uint16(1130), - 40: uint16(365), - 41: uint16(365), - 42: uint16(55), - 43: uint16(278), - 44: uint16(436), - 45: uint16(713), - 46: uint16(713), - 47: uint16(201), - 48: uint16(201), - 49: uint16(201), - 50: uint16(201), + 0: uint16(2029), + 1: uint16(1801), + 2: uint16(2043), + 3: uint16(1380), + 4: uint16(1380), + 5: uint16(318), + 6: uint16(271), + 7: uint16(1496), + 8: uint16(1569), + 9: uint16(1642), + 10: uint16(702), + 11: uint16(702), + 12: uint16(702), + 13: uint16(740), + 14: uint16(318), + 15: uint16(318), + 16: uint16(318), + 17: uint16(318), + 18: uint16(318), + 21: uint16(216), + 22: uint16(1177), + 23: uint16(702), + 24: uint16(702), + 25: uint16(702), + 26: uint16(702), + 27: uint16(702), + 28: uint16(702), + 29: uint16(702), + 30: uint16(702), + 31: uint16(702), + 32: uint16(702), + 33: uint16(702), + 34: uint16(702), + 35: uint16(702), + 36: uint16(702), + 37: uint16(702), + 38: uint16(503), + 39: uint16(503), + 40: uint16(111), + 41: uint16(111), + 42: uint16(217), + 43: uint16(287), + 44: uint16(348), + 45: uint16(610), + 46: uint16(610), + 47: uint16(736), + 48: uint16(736), + 49: uint16(736), + 50: uint16(736), 51: uint16(40), - 52: uint16(111), - 53: uint16(258), - 54: uint16(361), - 55: uint16(469), - 56: uint16(512), - 57: uint16(583), - 58: uint16(622), - 59: uint16(693), - 60: uint16(732), - 61: uint16(803), - 62: uint16(842), - 63: uint16(913), - 64: uint16(1073), - 65: uint16(1093), - 66: uint16(1093), - 67: uint16(1093), - 68: uint16(1093), - 69: uint16(1093), - 70: uint16(1093), - 71: uint16(1093), - 72: uint16(1093), - 73: uint16(1093), - 74: uint16(1093), - 75: uint16(1093), - 76: uint16(1093), - 77: uint16(1093), - 78: uint16(1093), - 79: uint16(1093), - 80: uint16(1093), - 81: uint16(1093), - 82: uint16(1093), - 83: uint16(1113), - 84: uint16(1093), - 85: uint16(1216), - 86: uint16(957), - 87: uint16(957), - 88: uint16(1523), - 89: uint16(1602), - 90: uint16(1674), - 91: uint16(1828), - 92: uint16(1828), - 93: uint16(1828), - 94: uint16(1828), - 95: uint16(1828), - 96: uint16(1828), - 97: uint16(1828), - 98: uint16(1828), - 99: uint16(1828), - 100: uint16(1828), - 101: uint16(1828), - 102: uint16(1828), - 103: uint16(1828), - 104: uint16(1828), - 105: uint16(1828), - 106: uint16(1828), - 107: uint16(1828), - 108: uint16(1828), - 109: uint16(1828), - 110: uint16(1828), - 111: uint16(1828), - 112: uint16(1828), - 113: uint16(1828), - 114: uint16(1828), - 115: uint16(1828), - 116: uint16(1828), - 117: uint16(1828), - 118: uint16(1828), - 119: uint16(1828), - 120: uint16(1828), - 121: uint16(1828), - 122: uint16(1828), - 123: uint16(1828), - 124: uint16(1828), - 125: uint16(1828), - 126: uint16(1828), - 127: uint16(1828), - 128: uint16(1828), - 129: uint16(1828), - 130: uint16(1828), - 131: uint16(1828), - 132: uint16(1828), - 133: uint16(1828), - 134: uint16(1828), - 135: uint16(1828), - 136: uint16(1828), - 137: uint16(1828), - 138: uint16(1828), - 139: uint16(1828), - 140: uint16(137), - 141: uint16(181), - 142: uint16(181), - 143: uint16(181), - 144: uint16(181), - 145: uint16(181), - 146: uint16(181), - 147: uint16(181), - 148: uint16(96), - 149: uint16(222), - 150: uint16(143), - 151: uint16(477), - 152: uint16(713), - 153: uint16(1133), - 154: uint16(1268), - 155: uint16(713), - 156: uint16(713), - 157: uint16(79), - 158: uint16(79), - 159: uint16(713), - 160: uint16(770), - 161: uint16(83), - 162: uint16(65), - 163: uint16(65), - 164: uint16(65), - 165: uint16(288), - 166: uint16(162), - 167: uint16(162), - 168: uint16(2142), - 169: uint16(2142), - 170: uint16(696), - 171: uint16(696), - 172: uint16(696), - 173: uint16(238), - 174: uint16(474), - 175: uint16(474), - 176: uint16(474), - 177: uint16(474), - 178: uint16(1217), - 179: uint16(1217), - 180: uint16(678), - 181: uint16(477), - 182: uint16(324), - 183: uint16(398), - 184: uint16(713), - 185: uint16(713), - 186: uint16(713), - 187: uint16(713), - 188: uint16(713), - 189: uint16(713), - 190: uint16(713), - 191: uint16(713), - 192: uint16(713), - 193: uint16(713), - 194: uint16(713), - 195: uint16(713), - 196: uint16(713), - 197: uint16(713), - 198: uint16(713), - 199: uint16(713), - 200: uint16(713), - 201: uint16(713), - 202: uint16(713), - 203: uint16(1220), - 204: uint16(366), - 205: uint16(366), - 206: uint16(713), - 207: uint16(917), - 208: uint16(283), - 209: uint16(283), - 210: uint16(434), - 211: uint16(434), - 212: uint16(605), - 213: uint16(605), - 214: uint16(1298), - 215: uint16(2142), - 216: uint16(2142), - 217: uint16(2142), - 218: uint16(2142), - 219: uint16(2142), - 220: uint16(2142), - 221: uint16(2142), - 222: uint16(1179), - 223: uint16(1157), - 224: uint16(1157), - 225: uint16(487), - 226: uint16(527), - 227: uint16(585), - 228: uint16(645), - 229: uint16(749), - 230: uint16(914), - 231: uint16(968), - 232: uint16(752), - 233: uint16(713), - 234: uint16(713), - 235: uint16(713), - 236: uint16(713), - 237: uint16(713), - 238: uint16(713), - 239: uint16(713), - 240: uint16(713), - 241: uint16(713), - 242: uint16(713), - 243: uint16(303), - 244: uint16(713), - 245: uint16(713), - 246: uint16(713), - 247: uint16(713), - 248: uint16(713), - 249: uint16(713), - 250: uint16(713), - 251: uint16(713), - 252: uint16(713), - 253: uint16(713), - 254: uint16(713), - 255: uint16(713), - 256: uint16(797), - 257: uint16(797), - 258: uint16(797), - 259: uint16(713), - 260: uint16(713), - 261: uint16(713), - 262: uint16(959), - 263: uint16(713), - 264: uint16(713), - 265: uint16(713), - 266: uint16(1169), - 267: uint16(1271), - 268: uint16(713), - 269: uint16(713), - 270: uint16(1330), - 271: uint16(713), - 272: uint16(713), - 273: uint16(713), - 274: uint16(713), - 275: uint16(713), - 276: uint16(713), - 277: uint16(713), - 278: uint16(713), - 279: uint16(629), - 280: uint16(7), - 281: uint16(91), - 282: uint16(876), - 283: uint16(876), - 284: uint16(876), - 285: uint16(876), - 286: uint16(953), - 287: uint16(91), - 288: uint16(91), - 289: uint16(1246), - 290: uint16(1065), - 291: uint16(1106), - 292: uint16(1374), - 293: uint16(1329), - 294: uint16(1348), - 295: uint16(468), - 296: uint16(1348), - 297: uint16(1394), - 298: uint16(785), - 299: uint16(1329), - 300: uint16(1329), - 301: uint16(785), - 302: uint16(1329), - 303: uint16(468), - 304: uint16(1394), - 305: uint16(859), - 306: uint16(854), - 307: uint16(1402), - 308: uint16(1449), - 309: uint16(1449), - 310: uint16(1449), - 311: uint16(1173), - 312: uint16(1173), - 313: uint16(1173), - 314: uint16(1173), - 315: uint16(1355), - 316: uint16(1355), - 317: uint16(1030), - 318: uint16(1341), - 319: uint16(405), - 320: uint16(1230), - 321: uint16(1795), - 322: uint16(1795), - 323: uint16(1711), - 324: uint16(1711), - 325: uint16(1829), - 326: uint16(1829), - 327: uint16(1711), - 328: uint16(1717), - 329: uint16(1719), - 330: uint16(1850), - 331: uint16(1833), - 332: uint16(1860), - 333: uint16(1860), - 334: uint16(1860), - 335: uint16(1860), - 336: uint16(1711), - 337: uint16(1868), - 338: uint16(1740), - 339: uint16(1719), - 340: uint16(1719), - 341: uint16(1740), - 342: uint16(1850), - 343: uint16(1833), - 344: uint16(1740), - 345: uint16(1833), - 346: uint16(1740), - 347: uint16(1711), - 348: uint16(1868), - 349: uint16(1745), - 350: uint16(1843), - 351: uint16(1711), - 352: uint16(1868), - 353: uint16(1887), - 354: uint16(1711), - 355: uint16(1868), - 356: uint16(1711), - 357: uint16(1868), - 358: uint16(1887), - 359: uint16(1801), - 360: uint16(1801), - 361: uint16(1801), - 362: uint16(1855), - 363: uint16(1900), - 364: uint16(1900), - 365: uint16(1887), - 366: uint16(1801), - 367: uint16(1797), - 368: uint16(1801), - 369: uint16(1855), - 370: uint16(1801), - 371: uint16(1801), - 372: uint16(1761), - 373: uint16(1912), - 374: uint16(1830), - 375: uint16(1830), - 376: uint16(1887), - 377: uint16(1711), - 378: uint16(1862), - 379: uint16(1862), - 380: uint16(1875), - 381: uint16(1875), - 382: uint16(1810), - 383: uint16(1815), - 384: uint16(1940), - 385: uint16(1711), - 386: uint16(1807), - 387: uint16(1810), - 388: uint16(1821), - 389: uint16(1823), - 390: uint16(1740), - 391: uint16(1945), - 392: uint16(1963), - 393: uint16(1963), - 394: uint16(1974), - 395: uint16(1974), - 396: uint16(1974), - 397: uint16(2142), - 398: uint16(2142), - 399: uint16(2142), - 400: uint16(2142), - 401: uint16(2142), - 402: uint16(2142), - 403: uint16(2142), - 404: uint16(2142), - 405: uint16(2142), - 406: uint16(2142), - 407: uint16(2142), - 408: uint16(2142), - 409: uint16(2142), - 410: uint16(2142), - 411: uint16(2142), - 412: uint16(20), - 413: uint16(1224), - 414: uint16(256), - 415: uint16(1111), - 416: uint16(1115), - 417: uint16(1114), - 418: uint16(1192), - 419: uint16(1496), - 420: uint16(1424), - 421: uint16(1505), - 422: uint16(1427), - 423: uint16(355), - 424: uint16(1383), - 425: uint16(1537), - 426: uint16(1506), - 427: uint16(1538), - 428: uint16(1553), - 429: uint16(1583), - 430: uint16(1584), - 431: uint16(1591), - 432: uint16(1625), - 433: uint16(541), - 434: uint16(1445), - 435: uint16(1562), - 436: uint16(1450), - 437: uint16(1572), - 438: uint16(1515), - 439: uint16(1428), - 440: uint16(1532), - 441: uint16(1592), - 442: uint16(1629), - 443: uint16(1520), - 444: uint16(1630), - 445: uint16(1639), - 446: uint16(1510), - 447: uint16(1544), - 448: uint16(1662), - 449: uint16(1675), - 450: uint16(1551), - 451: uint16(48), - 452: uint16(1996), - 453: uint16(2001), - 454: uint16(1983), - 455: uint16(1844), - 456: uint16(1993), - 457: uint16(1994), - 458: uint16(1986), - 459: uint16(1989), - 460: uint16(1874), - 461: uint16(1863), - 462: uint16(1885), - 463: uint16(1991), - 464: uint16(1991), - 465: uint16(1995), - 466: uint16(1876), - 467: uint16(1997), - 468: uint16(1877), - 469: uint16(2004), - 470: uint16(2021), - 471: uint16(1881), - 472: uint16(1894), - 473: uint16(1991), - 474: uint16(1895), - 475: uint16(1965), - 476: uint16(1990), - 477: uint16(1991), - 478: uint16(1878), - 479: uint16(1975), - 480: uint16(1977), - 481: uint16(1978), - 482: uint16(1979), - 483: uint16(1903), - 484: uint16(1918), - 485: uint16(2002), - 486: uint16(1896), - 487: uint16(2034), - 488: uint16(2033), - 489: uint16(2017), - 490: uint16(1925), - 491: uint16(1880), - 492: uint16(1976), - 493: uint16(2018), - 494: uint16(1980), - 495: uint16(1967), - 496: uint16(2005), - 497: uint16(1904), - 498: uint16(1932), - 499: uint16(2025), - 500: uint16(2030), - 501: uint16(2032), - 502: uint16(1921), - 503: uint16(1928), - 504: uint16(2035), - 505: uint16(1987), - 506: uint16(2036), - 507: uint16(2037), - 508: uint16(2038), - 509: uint16(2040), - 510: uint16(1988), - 511: uint16(2006), - 512: uint16(2039), - 513: uint16(1960), - 514: uint16(2041), - 515: uint16(2042), - 516: uint16(1999), - 517: uint16(2023), + 52: uint16(112), + 53: uint16(320), + 54: uint16(340), + 55: uint16(445), + 56: uint16(489), + 57: uint16(593), + 58: uint16(637), + 59: uint16(741), + 60: uint16(785), + 61: uint16(889), + 62: uint16(909), + 63: uint16(1023), + 64: uint16(1043), + 65: uint16(1157), + 66: uint16(1177), + 67: uint16(1177), + 68: uint16(1177), + 69: uint16(1177), + 70: uint16(1177), + 71: uint16(1177), + 72: uint16(1177), + 73: uint16(1177), + 74: uint16(1177), + 75: uint16(1177), + 76: uint16(1177), + 77: uint16(1177), + 78: uint16(1177), + 79: uint16(1177), + 80: uint16(1177), + 81: uint16(1177), + 82: uint16(1177), + 83: uint16(1177), + 84: uint16(1197), + 85: uint16(1177), + 86: uint16(1301), + 87: uint16(1321), + 88: uint16(1321), + 89: uint16(554), + 90: uint16(1802), + 91: uint16(1910), + 92: uint16(702), + 93: uint16(702), + 94: uint16(702), + 95: uint16(702), + 96: uint16(702), + 97: uint16(702), + 98: uint16(702), + 99: uint16(702), + 100: uint16(702), + 101: uint16(702), + 102: uint16(702), + 103: uint16(702), + 104: uint16(702), + 105: uint16(702), + 106: uint16(702), + 107: uint16(702), + 108: uint16(702), + 109: uint16(702), + 110: uint16(702), + 111: uint16(702), + 112: uint16(702), + 113: uint16(702), + 114: uint16(702), + 115: uint16(702), + 116: uint16(702), + 117: uint16(702), + 118: uint16(702), + 119: uint16(702), + 120: uint16(702), + 121: uint16(702), + 122: uint16(702), + 123: uint16(702), + 124: uint16(702), + 125: uint16(702), + 126: uint16(702), + 127: uint16(702), + 128: uint16(702), + 129: uint16(702), + 130: uint16(702), + 131: uint16(702), + 132: uint16(702), + 133: uint16(702), + 134: uint16(702), + 135: uint16(702), + 136: uint16(702), + 137: uint16(702), + 138: uint16(702), + 139: uint16(702), + 140: uint16(702), + 141: uint16(702), + 142: uint16(138), + 143: uint16(198), + 144: uint16(198), + 145: uint16(198), + 146: uint16(198), + 147: uint16(198), + 148: uint16(198), + 149: uint16(198), + 150: uint16(183), + 151: uint16(99), + 152: uint16(169), + 153: uint16(549), + 154: uint16(610), + 155: uint16(151), + 156: uint16(542), + 157: uint16(610), + 158: uint16(610), + 159: uint16(1017), + 160: uint16(1017), + 161: uint16(610), + 162: uint16(1001), + 163: uint16(350), + 164: uint16(464), + 165: uint16(464), + 166: uint16(464), + 167: uint16(586), + 168: uint16(1), + 169: uint16(1), + 170: uint16(2207), + 171: uint16(2207), + 172: uint16(854), + 173: uint16(854), + 174: uint16(854), + 175: uint16(465), + 176: uint16(694), + 177: uint16(694), + 178: uint16(694), + 179: uint16(694), + 180: uint16(1096), + 181: uint16(1096), + 182: uint16(825), + 183: uint16(549), + 184: uint16(847), + 185: uint16(904), + 186: uint16(610), + 187: uint16(610), + 188: uint16(610), + 189: uint16(610), + 190: uint16(610), + 191: uint16(610), + 192: uint16(610), + 193: uint16(610), + 194: uint16(610), + 195: uint16(610), + 196: uint16(610), + 197: uint16(610), + 198: uint16(610), + 199: uint16(610), + 200: uint16(610), + 201: uint16(610), + 202: uint16(610), + 203: uint16(610), + 204: uint16(610), + 205: uint16(488), + 206: uint16(947), + 207: uint16(947), + 208: uint16(610), + 209: uint16(1129), + 210: uint16(495), + 211: uint16(495), + 212: uint16(1139), + 213: uint16(1139), + 214: uint16(967), + 215: uint16(967), + 216: uint16(1173), + 217: uint16(2207), + 218: uint16(2207), + 219: uint16(2207), + 220: uint16(2207), + 221: uint16(2207), + 222: uint16(2207), + 223: uint16(2207), + 224: uint16(617), + 225: uint16(765), + 226: uint16(765), + 227: uint16(697), + 228: uint16(444), + 229: uint16(708), + 230: uint16(660), + 231: uint16(745), + 232: uint16(510), + 233: uint16(663), + 234: uint16(864), + 235: uint16(610), + 236: uint16(610), + 237: uint16(610), + 238: uint16(610), + 239: uint16(610), + 240: uint16(610), + 241: uint16(610), + 242: uint16(610), + 243: uint16(610), + 244: uint16(610), + 245: uint16(188), + 246: uint16(610), + 247: uint16(610), + 248: uint16(610), + 249: uint16(610), + 250: uint16(610), + 251: uint16(610), + 252: uint16(610), + 253: uint16(610), + 254: uint16(610), + 255: uint16(610), + 256: uint16(610), + 257: uint16(610), + 258: uint16(839), + 259: uint16(839), + 260: uint16(839), + 261: uint16(610), + 262: uint16(610), + 263: uint16(610), + 264: uint16(1155), + 265: uint16(610), + 266: uint16(610), + 267: uint16(610), + 268: uint16(1119), + 269: uint16(1247), + 270: uint16(610), + 271: uint16(1353), + 272: uint16(610), + 273: uint16(610), + 274: uint16(610), + 275: uint16(610), + 276: uint16(610), + 277: uint16(610), + 278: uint16(610), + 279: uint16(610), + 280: uint16(1063), + 281: uint16(494), + 282: uint16(1101), + 283: uint16(291), + 284: uint16(291), + 285: uint16(291), + 286: uint16(291), + 287: uint16(1319), + 288: uint16(1101), + 289: uint16(1101), + 290: uint16(775), + 291: uint16(1221), + 292: uint16(1375), + 293: uint16(1452), + 294: uint16(667), + 295: uint16(1341), + 296: uint16(1198), + 297: uint16(1341), + 298: uint16(1435), + 299: uint16(1487), + 300: uint16(667), + 301: uint16(667), + 302: uint16(1487), + 303: uint16(667), + 304: uint16(1198), + 305: uint16(1435), + 306: uint16(777), + 307: uint16(1011), + 308: uint16(1423), + 309: uint16(584), + 310: uint16(584), + 311: uint16(584), + 312: uint16(1273), + 313: uint16(1273), + 314: uint16(1273), + 315: uint16(1273), + 316: uint16(1471), + 317: uint16(1471), + 318: uint16(880), + 319: uint16(1530), + 320: uint16(1190), + 321: uint16(1095), + 322: uint16(1731), + 323: uint16(1731), + 324: uint16(1668), + 325: uint16(1668), + 326: uint16(1794), + 327: uint16(1794), + 328: uint16(1668), + 329: uint16(1683), + 330: uint16(1685), + 331: uint16(1815), + 332: uint16(1796), + 333: uint16(1824), + 334: uint16(1824), + 335: uint16(1824), + 336: uint16(1824), + 337: uint16(1668), + 338: uint16(1828), + 339: uint16(1701), + 340: uint16(1685), + 341: uint16(1685), + 342: uint16(1701), + 343: uint16(1815), + 344: uint16(1796), + 345: uint16(1701), + 346: uint16(1796), + 347: uint16(1701), + 348: uint16(1668), + 349: uint16(1828), + 350: uint16(1697), + 351: uint16(1800), + 352: uint16(1668), + 353: uint16(1828), + 354: uint16(1848), + 355: uint16(1668), + 356: uint16(1828), + 357: uint16(1668), + 358: uint16(1828), + 359: uint16(1848), + 360: uint16(1766), + 361: uint16(1766), + 362: uint16(1766), + 363: uint16(1823), + 364: uint16(1870), + 365: uint16(1870), + 366: uint16(1848), + 367: uint16(1766), + 368: uint16(1767), + 369: uint16(1766), + 370: uint16(1823), + 371: uint16(1766), + 372: uint16(1766), + 373: uint16(1727), + 374: uint16(1872), + 375: uint16(1783), + 376: uint16(1783), + 377: uint16(1848), + 378: uint16(1668), + 379: uint16(1813), + 380: uint16(1813), + 381: uint16(1825), + 382: uint16(1825), + 383: uint16(1777), + 384: uint16(1781), + 385: uint16(1906), + 386: uint16(1668), + 387: uint16(1774), + 388: uint16(1777), + 389: uint16(1789), + 390: uint16(1792), + 391: uint16(1701), + 392: uint16(1919), + 393: uint16(1935), + 394: uint16(1935), + 395: uint16(1949), + 396: uint16(1949), + 397: uint16(1949), + 398: uint16(2207), + 399: uint16(2207), + 400: uint16(2207), + 401: uint16(2207), + 402: uint16(2207), + 403: uint16(2207), + 404: uint16(2207), + 405: uint16(2207), + 406: uint16(2207), + 407: uint16(2207), + 408: uint16(2207), + 409: uint16(2207), + 410: uint16(2207), + 411: uint16(2207), + 412: uint16(2207), + 413: uint16(69), + 414: uint16(1032), + 415: uint16(79), + 416: uint16(357), + 417: uint16(1377), + 418: uint16(1206), + 419: uint16(400), + 420: uint16(1525), + 421: uint16(835), + 422: uint16(332), + 423: uint16(1540), + 424: uint16(1437), + 425: uint16(1539), + 426: uint16(1536), + 427: uint16(1548), + 428: uint16(1583), + 429: uint16(1620), + 430: uint16(1633), + 431: uint16(1670), + 432: uint16(1671), + 433: uint16(1674), + 434: uint16(1567), + 435: uint16(1553), + 436: uint16(1682), + 437: uint16(1506), + 438: uint16(1675), + 439: uint16(1358), + 440: uint16(1607), + 441: uint16(1589), + 442: uint16(1678), + 443: uint16(1681), + 444: uint16(1624), + 445: uint16(1687), + 446: uint16(1688), + 447: uint16(1283), + 448: uint16(1561), + 449: uint16(1693), + 450: uint16(1696), + 451: uint16(1623), + 452: uint16(1521), + 453: uint16(1976), + 454: uint16(1980), + 455: uint16(1962), + 456: uint16(1822), + 457: uint16(1972), + 458: uint16(1973), + 459: uint16(1965), + 460: uint16(1967), + 461: uint16(1851), + 462: uint16(1840), + 463: uint16(1862), + 464: uint16(1969), + 465: uint16(1969), + 466: uint16(1971), + 467: uint16(1853), + 468: uint16(1977), + 469: uint16(1854), + 470: uint16(1982), + 471: uint16(1999), + 472: uint16(1858), + 473: uint16(1871), + 474: uint16(1969), + 475: uint16(1873), + 476: uint16(1941), + 477: uint16(1968), + 478: uint16(1969), + 479: uint16(1855), + 480: uint16(1952), + 481: uint16(1954), + 482: uint16(1955), + 483: uint16(1956), + 484: uint16(1881), + 485: uint16(1896), + 486: uint16(1981), + 487: uint16(1874), + 488: uint16(2013), + 489: uint16(2014), + 490: uint16(1998), + 491: uint16(1905), + 492: uint16(1860), + 493: uint16(1957), + 494: uint16(2008), + 495: uint16(1966), + 496: uint16(1947), + 497: uint16(1983), + 498: uint16(1894), + 499: uint16(1921), + 500: uint16(2020), + 501: uint16(2018), + 502: uint16(2026), + 503: uint16(1915), + 504: uint16(1923), + 505: uint16(2028), + 506: uint16(1984), + 507: uint16(2036), + 508: uint16(2040), + 509: uint16(2047), + 510: uint16(2041), + 511: uint16(2003), + 512: uint16(2012), + 513: uint16(2050), + 514: uint16(1979), + 515: uint16(2049), + 516: uint16(2056), + 517: uint16(2011), 518: uint16(2044), - 519: uint16(2043), - 520: uint16(1919), - 521: uint16(2048), - 522: uint16(2049), - 523: uint16(2050), - 524: uint16(2046), - 525: uint16(2051), - 526: uint16(2053), - 527: uint16(1981), - 528: uint16(1935), - 529: uint16(2056), - 530: uint16(2057), - 531: uint16(1966), - 532: uint16(2047), - 533: uint16(2061), - 534: uint16(1941), - 535: uint16(2060), - 536: uint16(2052), - 537: uint16(2054), - 538: uint16(2055), - 539: uint16(2058), - 540: uint16(2003), - 541: uint16(2012), - 542: uint16(2007), - 543: uint16(2059), - 544: uint16(2015), - 545: uint16(2008), - 546: uint16(2062), - 547: uint16(2071), - 548: uint16(2073), - 549: uint16(2074), - 550: uint16(2072), - 551: uint16(2075), - 552: uint16(2065), - 553: uint16(1962), - 554: uint16(1964), - 555: uint16(2079), - 556: uint16(2060), - 557: uint16(2082), - 558: uint16(2084), - 559: uint16(2085), - 560: uint16(2087), - 561: uint16(2086), - 562: uint16(2089), - 563: uint16(2088), - 564: uint16(2091), - 565: uint16(2093), - 566: uint16(2099), - 567: uint16(2094), - 568: uint16(2095), - 569: uint16(2096), - 570: uint16(2097), - 571: uint16(2100), - 572: uint16(2101), - 573: uint16(2102), - 574: uint16(1998), - 575: uint16(1984), - 576: uint16(1985), - 577: uint16(2000), - 578: uint16(2103), - 579: uint16(2098), - 580: uint16(2109), - 581: uint16(2117), - 582: uint16(2128), -} -var _yy_reduce_ofst = [412]int16{ - 0: int16(-int32(71)), - 1: int16(194), - 2: int16(343), - 3: int16(835), - 4: int16(-int32(180)), - 5: int16(-int32(177)), - 6: int16(838), - 7: int16(-int32(194)), - 8: int16(-int32(188)), - 9: int16(-int32(185)), - 10: int16(-int32(183)), - 11: int16(82), - 12: int16(183), - 13: int16(-int32(65)), - 14: int16(133), - 15: int16(245), - 16: int16(346), - 17: int16(407), - 18: int16(458), - 19: int16(-int32(178)), - 20: int16(75), - 21: int16(-int32(275)), - 22: int16(-int32(4)), - 23: int16(310), - 24: int16(312), - 25: int16(489), - 26: int16(575), - 27: int16(596), - 28: int16(463), - 29: int16(686), - 30: int16(707), - 31: int16(725), - 32: int16(780), - 33: int16(1098), - 34: int16(856), - 35: int16(778), - 36: int16(1059), - 37: int16(1090), - 38: int16(708), - 39: int16(887), - 40: int16(86), - 41: int16(448), - 42: int16(980), - 43: int16(630), - 44: int16(680), - 45: int16(681), - 46: int16(684), - 47: int16(796), - 48: int16(801), - 49: int16(796), - 50: int16(801), - 51: int16(-int32(261)), - 52: int16(-int32(261)), - 53: int16(-int32(261)), - 54: int16(-int32(261)), - 55: int16(-int32(261)), - 56: int16(-int32(261)), - 57: int16(-int32(261)), - 58: int16(-int32(261)), - 59: int16(-int32(261)), - 60: int16(-int32(261)), - 61: int16(-int32(261)), - 62: int16(-int32(261)), - 63: int16(-int32(261)), - 64: int16(-int32(261)), - 65: int16(-int32(261)), - 66: int16(-int32(261)), - 67: int16(-int32(261)), - 68: int16(-int32(261)), - 69: int16(-int32(261)), - 70: int16(-int32(261)), - 71: int16(-int32(261)), - 72: int16(-int32(261)), - 73: int16(-int32(261)), - 74: int16(-int32(261)), - 75: int16(-int32(261)), - 76: int16(-int32(261)), - 77: int16(-int32(261)), - 78: int16(-int32(261)), - 79: int16(-int32(261)), - 80: int16(-int32(261)), - 81: int16(-int32(261)), - 82: int16(-int32(261)), - 83: int16(-int32(261)), - 84: int16(-int32(261)), - 85: int16(-int32(261)), - 86: int16(-int32(261)), - 87: int16(-int32(261)), - 88: int16(391), - 89: int16(886), - 90: int16(888), - 91: int16(1013), - 92: int16(1016), - 93: int16(1081), - 94: int16(1087), - 95: int16(1151), - 96: int16(1159), - 97: int16(1177), - 98: int16(1185), - 99: int16(1188), - 100: int16(1190), - 101: int16(1194), - 102: int16(1197), - 103: int16(1203), - 104: int16(1247), - 105: int16(1260), - 106: int16(1264), - 107: int16(1267), - 108: int16(1269), - 109: int16(1273), - 110: int16(1315), - 111: int16(1322), - 112: int16(1335), - 113: int16(1337), - 114: int16(1356), - 115: int16(1362), - 116: int16(1418), - 117: int16(1425), - 118: int16(1453), - 119: int16(1457), - 120: int16(1465), - 121: int16(1473), - 122: int16(1487), - 123: int16(1495), - 124: int16(1507), - 125: int16(1517), - 126: int16(1521), - 127: int16(1534), - 128: int16(1543), - 129: int16(1546), - 130: int16(1549), - 131: int16(1552), - 132: int16(1554), - 133: int16(1560), - 134: int16(1581), - 135: int16(1590), - 136: int16(1593), - 137: int16(1595), - 138: int16(1621), - 139: int16(1623), - 140: int16(-int32(261)), - 141: int16(-int32(261)), - 142: int16(-int32(261)), - 143: int16(-int32(261)), - 144: int16(-int32(261)), - 145: int16(-int32(261)), - 146: int16(-int32(261)), - 147: int16(-int32(261)), - 148: int16(-int32(261)), - 149: int16(-int32(261)), - 150: int16(-int32(261)), - 151: int16(-int32(186)), - 152: int16(-int32(117)), - 153: int16(260), - 154: int16(263), - 155: int16(460), - 156: int16(631), - 157: int16(-int32(74)), - 158: int16(497), - 159: int16(-int32(181)), - 160: int16(-int32(261)), - 161: int16(939), - 162: int16(176), - 163: int16(274), - 164: int16(338), - 165: int16(676), - 166: int16(-int32(261)), - 167: int16(-int32(261)), - 168: int16(-int32(261)), - 169: int16(-int32(261)), - 170: int16(-int32(212)), - 171: int16(-int32(212)), - 172: int16(-int32(212)), - 173: int16(-int32(184)), - 174: int16(149), - 175: int16(777), - 176: int16(1061), - 177: int16(1103), - 178: int16(265), - 179: int16(419), - 180: int16(-int32(254)), - 181: int16(670), - 182: int16(677), - 183: int16(677), - 184: int16(-int32(11)), - 185: int16(-int32(129)), - 186: int16(184), - 187: int16(488), - 188: int16(736), - 189: int16(789), - 190: int16(805), - 191: int16(844), - 192: int16(403), - 193: int16(529), - 194: int16(579), - 195: int16(668), - 196: int16(783), - 197: int16(841), - 198: int16(1158), - 199: int16(1112), - 200: int16(806), - 201: int16(861), - 202: int16(1095), - 203: int16(846), - 204: int16(839), - 205: int16(1031), - 206: int16(-int32(189)), - 207: int16(1077), - 208: int16(1080), - 209: int16(1116), - 210: int16(1084), - 211: int16(1156), - 212: int16(1139), - 213: int16(1221), - 214: int16(46), - 215: int16(1099), - 216: int16(1037), - 217: int16(1118), - 218: int16(1171), - 219: int16(1214), - 220: int16(1210), - 221: int16(1258), - 222: int16(-int32(210)), - 223: int16(-int32(190)), - 224: int16(-int32(176)), - 225: int16(-int32(115)), - 226: int16(117), - 227: int16(262), - 228: int16(376), - 229: int16(490), - 230: int16(511), - 231: int16(520), - 232: int16(618), - 233: int16(639), - 234: int16(743), - 235: int16(901), - 236: int16(907), - 237: int16(958), - 238: int16(1014), - 239: int16(1055), - 240: int16(1108), - 241: int16(1193), - 242: int16(1244), - 243: int16(720), - 244: int16(1248), - 245: int16(1277), - 246: int16(1324), - 247: int16(1347), - 248: int16(1417), - 249: int16(1431), - 250: int16(1432), - 251: int16(1440), - 252: int16(1451), - 253: int16(1452), - 254: int16(1463), - 255: int16(1478), - 256: int16(1286), - 257: int16(1350), - 258: int16(1369), - 259: int16(1490), - 260: int16(1498), - 261: int16(1501), - 262: int16(773), - 263: int16(1509), - 264: int16(1513), - 265: int16(1528), - 266: int16(1292), - 267: int16(1367), - 268: int16(1535), - 269: int16(1536), - 270: int16(1477), - 271: int16(1542), - 272: int16(376), - 273: int16(1547), - 274: int16(1550), - 275: int16(1555), - 276: int16(1559), - 277: int16(1568), - 278: int16(1571), - 279: int16(1441), + 519: uint16(2057), + 520: uint16(2048), + 521: uint16(1934), + 522: uint16(2063), + 523: uint16(2064), + 524: uint16(2065), + 525: uint16(2061), + 526: uint16(2066), + 527: uint16(2068), + 528: uint16(1993), + 529: uint16(1950), + 530: uint16(2071), + 531: uint16(2072), + 532: uint16(1985), + 533: uint16(2062), + 534: uint16(2075), + 535: uint16(1959), + 536: uint16(2073), + 537: uint16(2067), + 538: uint16(2070), + 539: uint16(2076), + 540: uint16(2078), + 541: uint16(2010), + 542: uint16(2030), + 543: uint16(2022), + 544: uint16(2069), + 545: uint16(2031), + 546: uint16(2021), + 547: uint16(2082), + 548: uint16(2094), + 549: uint16(2083), + 550: uint16(2095), + 551: uint16(2093), + 552: uint16(2096), + 553: uint16(2086), + 554: uint16(1986), + 555: uint16(1987), + 556: uint16(2100), + 557: uint16(2073), + 558: uint16(2101), + 559: uint16(2103), + 560: uint16(2104), + 561: uint16(2109), + 562: uint16(2107), + 563: uint16(2108), + 564: uint16(2111), + 565: uint16(2113), + 566: uint16(2125), + 567: uint16(2115), + 568: uint16(2116), + 569: uint16(2117), + 570: uint16(2118), + 571: uint16(2121), + 572: uint16(2122), + 573: uint16(2114), + 574: uint16(2009), + 575: uint16(2004), + 576: uint16(2005), + 577: uint16(2006), + 578: uint16(2124), + 579: uint16(2127), + 580: uint16(2136), + 581: uint16(2151), + 582: uint16(2152), +} +var _yy_reduce_ofst = [413]int16{ + 0: int16(-int32(67)), + 1: int16(1252), + 2: int16(-int32(64)), + 3: int16(-int32(178)), + 4: int16(-int32(181)), + 5: int16(160), + 6: int16(1071), + 7: int16(143), + 8: int16(-int32(184)), + 9: int16(137), + 10: int16(218), + 11: int16(220), + 12: int16(222), + 13: int16(-int32(174)), + 14: int16(229), + 15: int16(268), + 16: int16(272), + 17: int16(275), + 18: int16(324), + 19: int16(-int32(208)), + 20: int16(242), + 21: int16(-int32(277)), + 22: int16(-int32(39)), + 23: int16(81), + 24: int16(537), + 25: int16(792), + 26: int16(810), + 27: int16(812), + 28: int16(-int32(189)), + 29: int16(814), + 30: int16(831), + 31: int16(163), + 32: int16(865), + 33: int16(944), + 34: int16(887), + 35: int16(840), + 36: int16(964), + 37: int16(1077), + 38: int16(-int32(187)), + 39: int16(292), + 40: int16(-int32(133)), + 41: int16(274), + 42: int16(673), + 43: int16(558), + 44: int16(682), + 45: int16(795), + 46: int16(809), + 47: int16(-int32(238)), + 48: int16(-int32(232)), + 49: int16(-int32(238)), + 50: int16(-int32(232)), + 51: int16(329), + 52: int16(329), + 53: int16(329), + 54: int16(329), + 55: int16(329), + 56: int16(329), + 57: int16(329), + 58: int16(329), + 59: int16(329), + 60: int16(329), + 61: int16(329), + 62: int16(329), + 63: int16(329), + 64: int16(329), + 65: int16(329), + 66: int16(329), + 67: int16(329), + 68: int16(329), + 69: int16(329), + 70: int16(329), + 71: int16(329), + 72: int16(329), + 73: int16(329), + 74: int16(329), + 75: int16(329), + 76: int16(329), + 77: int16(329), + 78: int16(329), + 79: int16(329), + 80: int16(329), + 81: int16(329), + 82: int16(329), + 83: int16(329), + 84: int16(329), + 85: int16(329), + 86: int16(329), + 87: int16(329), + 88: int16(329), + 89: int16(557), + 90: int16(712), + 91: int16(949), + 92: int16(966), + 93: int16(969), + 94: int16(971), + 95: int16(979), + 96: int16(1097), + 97: int16(1099), + 98: int16(1103), + 99: int16(1142), + 100: int16(1144), + 101: int16(1169), + 102: int16(1172), + 103: int16(1201), + 104: int16(1203), + 105: int16(1228), + 106: int16(1241), + 107: int16(1250), + 108: int16(1253), + 109: int16(1255), + 110: int16(1261), + 111: int16(1266), + 112: int16(1271), + 113: int16(1282), + 114: int16(1291), + 115: int16(1308), + 116: int16(1310), + 117: int16(1312), + 118: int16(1322), + 119: int16(1328), + 120: int16(1347), + 121: int16(1354), + 122: int16(1356), + 123: int16(1359), + 124: int16(1362), + 125: int16(1365), + 126: int16(1367), + 127: int16(1374), + 128: int16(1376), + 129: int16(1381), + 130: int16(1401), + 131: int16(1403), + 132: int16(1406), + 133: int16(1412), + 134: int16(1414), + 135: int16(1417), + 136: int16(1421), + 137: int16(1428), + 138: int16(1447), + 139: int16(1449), + 140: int16(1453), + 141: int16(1462), + 142: int16(329), + 143: int16(329), + 144: int16(329), + 145: int16(329), + 146: int16(329), + 147: int16(329), + 148: int16(329), + 149: int16(329), + 150: int16(329), + 151: int16(329), + 152: int16(329), + 153: int16(-int32(22)), + 154: int16(-int32(159)), + 155: int16(475), + 156: int16(-int32(220)), + 157: int16(756), + 158: int16(38), + 159: int16(501), + 160: int16(841), + 161: int16(714), + 162: int16(329), + 163: int16(118), + 164: int16(337), + 165: int16(349), + 166: int16(363), + 167: int16(-int32(56)), + 168: int16(329), + 169: int16(329), + 170: int16(329), + 171: int16(329), + 172: int16(-int32(205)), + 173: int16(-int32(205)), + 174: int16(-int32(205)), + 175: int16(687), + 176: int16(-int32(172)), + 177: int16(-int32(130)), + 178: int16(-int32(57)), + 179: int16(790), + 180: int16(397), + 181: int16(528), + 182: int16(-int32(271)), + 183: int16(136), + 184: int16(596), + 185: int16(596), + 186: int16(90), + 187: int16(316), + 188: int16(522), + 189: int16(541), + 190: int16(-int32(37)), + 191: int16(715), + 192: int16(849), + 193: int16(977), + 194: int16(628), + 195: int16(856), + 196: int16(980), + 197: int16(991), + 198: int16(1081), + 199: int16(1102), + 200: int16(1135), + 201: int16(1083), + 202: int16(-int32(162)), + 203: int16(208), + 204: int16(1258), + 205: int16(794), + 206: int16(-int32(86)), + 207: int16(159), + 208: int16(41), + 209: int16(1109), + 210: int16(671), + 211: int16(852), + 212: int16(844), + 213: int16(932), + 214: int16(1175), + 215: int16(1254), + 216: int16(480), + 217: int16(1180), + 218: int16(100), + 219: int16(258), + 220: int16(1265), + 221: int16(1268), + 222: int16(1216), + 223: int16(1287), + 224: int16(-int32(139)), + 225: int16(317), + 226: int16(344), + 227: int16(63), + 228: int16(339), + 229: int16(423), + 230: int16(563), + 231: int16(636), + 232: int16(676), + 233: int16(813), + 234: int16(908), + 235: int16(914), + 236: int16(950), + 237: int16(1078), + 238: int16(1084), + 239: int16(1098), + 240: int16(1363), + 241: int16(1384), + 242: int16(1407), + 243: int16(1439), + 244: int16(1464), + 245: int16(411), + 246: int16(1527), + 247: int16(1534), + 248: int16(1535), + 249: int16(1537), + 250: int16(1541), + 251: int16(1542), + 252: int16(1543), + 253: int16(1544), + 254: int16(1545), + 255: int16(1547), + 256: int16(1549), + 257: int16(1550), + 258: int16(990), + 259: int16(1164), + 260: int16(1492), + 261: int16(1551), + 262: int16(1552), + 263: int16(1556), + 264: int16(1217), + 265: int16(1558), + 266: int16(1559), + 267: int16(1560), + 268: int16(1473), + 269: int16(1413), + 270: int16(1563), + 271: int16(1510), + 272: int16(1568), + 273: int16(563), + 274: int16(1570), + 275: int16(1571), + 276: int16(1572), + 277: int16(1573), + 278: int16(1574), + 279: int16(1575), 280: int16(1443), - 281: int16(1474), - 282: int16(1511), - 283: int16(1516), - 284: int16(1519), - 285: int16(1522), - 286: int16(773), - 287: int16(1474), - 288: int16(1474), - 289: int16(1503), - 290: int16(1567), - 291: int16(1594), - 292: int16(1484), - 293: int16(1527), - 294: int16(1556), - 295: int16(1570), - 296: int16(1557), - 297: int16(1524), - 298: int16(1573), - 299: int16(1545), - 300: int16(1548), - 301: int16(1576), - 302: int16(1561), - 303: int16(1587), - 304: int16(1540), - 305: int16(1575), - 306: int16(1606), - 307: int16(1611), - 308: int16(1622), - 309: int16(1624), - 310: int16(1626), - 311: int16(1582), - 312: int16(1597), - 313: int16(1598), - 314: int16(1599), - 315: int16(1601), - 316: int16(1603), - 317: int16(1563), - 318: int16(1608), - 319: int16(1605), - 320: int16(1604), - 321: int16(1564), - 322: int16(1566), - 323: int16(1655), - 324: int16(1660), - 325: int16(1578), - 326: int16(1579), - 327: int16(1665), - 328: int16(1586), - 329: int16(1607), - 330: int16(1610), - 331: int16(1642), - 332: int16(1641), - 333: int16(1645), - 334: int16(1646), - 335: int16(1647), - 336: int16(1679), - 337: int16(1688), - 338: int16(1644), - 339: int16(1618), - 340: int16(1619), - 341: int16(1648), - 342: int16(1628), - 343: int16(1659), - 344: int16(1649), - 345: int16(1663), - 346: int16(1650), - 347: int16(1700), - 348: int16(1702), - 349: int16(1612), - 350: int16(1615), - 351: int16(1706), - 352: int16(1708), - 353: int16(1689), - 354: int16(1709), - 355: int16(1712), - 356: int16(1713), - 357: int16(1715), - 358: int16(1691), - 359: int16(1698), - 360: int16(1699), - 361: int16(1701), - 362: int16(1693), - 363: int16(1704), - 364: int16(1707), - 365: int16(1705), - 366: int16(1714), - 367: int16(1703), - 368: int16(1718), - 369: int16(1710), - 370: int16(1720), - 371: int16(1721), - 372: int16(1632), - 373: int16(1634), - 374: int16(1664), - 375: int16(1666), - 376: int16(1729), - 377: int16(1751), - 378: int16(1635), - 379: int16(1636), - 380: int16(1692), - 381: int16(1694), - 382: int16(1716), - 383: int16(1722), - 384: int16(1684), - 385: int16(1763), - 386: int16(1685), - 387: int16(1723), - 388: int16(1724), - 389: int16(1727), - 390: int16(1730), - 391: int16(1768), - 392: int16(1783), - 393: int16(1784), - 394: int16(1793), - 395: int16(1794), - 396: int16(1796), - 397: int16(1683), - 398: int16(1686), - 399: int16(1690), - 400: int16(1782), - 401: int16(1779), - 402: int16(1780), - 403: int16(1781), - 404: int16(1785), - 405: int16(1788), - 406: int16(1774), - 407: int16(1775), - 408: int16(1786), - 409: int16(1787), - 410: int16(1789), - 411: int16(1798), + 281: int16(1466), + 282: int16(1518), + 283: int16(1513), + 284: int16(1514), + 285: int16(1515), + 286: int16(1516), + 287: int16(1217), + 288: int16(1518), + 289: int16(1518), + 290: int16(1531), + 291: int16(1562), + 292: int16(1582), + 293: int16(1477), + 294: int16(1505), + 295: int16(1511), + 296: int16(1533), + 297: int16(1512), + 298: int16(1488), + 299: int16(1538), + 300: int16(1509), + 301: int16(1517), + 302: int16(1546), + 303: int16(1519), + 304: int16(1557), + 305: int16(1489), + 306: int16(1565), + 307: int16(1564), + 308: int16(1578), + 309: int16(1586), + 310: int16(1587), + 311: int16(1588), + 312: int16(1526), + 313: int16(1528), + 314: int16(1554), + 315: int16(1555), + 316: int16(1576), + 317: int16(1577), + 318: int16(1566), + 319: int16(1579), + 320: int16(1584), + 321: int16(1591), + 322: int16(1520), + 323: int16(1523), + 324: int16(1617), + 325: int16(1628), + 326: int16(1580), + 327: int16(1581), + 328: int16(1632), + 329: int16(1585), + 330: int16(1590), + 331: int16(1593), + 332: int16(1604), + 333: int16(1605), + 334: int16(1606), + 335: int16(1608), + 336: int16(1609), + 337: int16(1641), + 338: int16(1649), + 339: int16(1610), + 340: int16(1592), + 341: int16(1594), + 342: int16(1611), + 343: int16(1595), + 344: int16(1616), + 345: int16(1612), + 346: int16(1618), + 347: int16(1613), + 348: int16(1651), + 349: int16(1654), + 350: int16(1596), + 351: int16(1598), + 352: int16(1655), + 353: int16(1663), + 354: int16(1650), + 355: int16(1673), + 356: int16(1680), + 357: int16(1677), + 358: int16(1684), + 359: int16(1653), + 360: int16(1664), + 361: int16(1666), + 362: int16(1667), + 363: int16(1662), + 364: int16(1669), + 365: int16(1672), + 366: int16(1676), + 367: int16(1686), + 368: int16(1679), + 369: int16(1691), + 370: int16(1689), + 371: int16(1692), + 372: int16(1694), + 373: int16(1597), + 374: int16(1599), + 375: int16(1619), + 376: int16(1630), + 377: int16(1699), + 378: int16(1700), + 379: int16(1602), + 380: int16(1615), + 381: int16(1648), + 382: int16(1657), + 383: int16(1690), + 384: int16(1698), + 385: int16(1658), + 386: int16(1729), + 387: int16(1652), + 388: int16(1695), + 389: int16(1702), + 390: int16(1704), + 391: int16(1703), + 392: int16(1741), + 393: int16(1754), + 394: int16(1758), + 395: int16(1768), + 396: int16(1769), + 397: int16(1771), + 398: int16(1660), + 399: int16(1661), + 400: int16(1665), + 401: int16(1752), + 402: int16(1756), + 403: int16(1757), + 404: int16(1759), + 405: int16(1760), + 406: int16(1764), + 407: int16(1745), + 408: int16(1753), + 409: int16(1762), + 410: int16(1763), + 411: int16(1761), + 412: int16(1772), } var _yy_default = [583]uint16{ 0: uint16(1663), @@ -153337,30 +155608,30 @@ var _yy_default = [583]uint16{ 62: uint16(1254), 63: uint16(1254), 64: uint16(1254), - 65: uint16(1543), - 66: uint16(1545), - 67: uint16(1508), - 68: uint16(1420), - 69: uint16(1419), - 70: uint16(1418), - 71: uint16(1417), - 72: uint16(1526), - 73: uint16(1385), - 74: uint16(1411), - 75: uint16(1404), - 76: uint16(1408), - 77: uint16(1487), - 78: uint16(1488), - 79: uint16(1486), - 80: uint16(1641), - 81: uint16(1493), - 82: uint16(1492), - 83: uint16(1254), - 84: uint16(1407), - 85: uint16(1455), - 86: uint16(1471), - 87: uint16(1454), - 88: uint16(1254), + 65: uint16(1254), + 66: uint16(1543), + 67: uint16(1545), + 68: uint16(1508), + 69: uint16(1420), + 70: uint16(1419), + 71: uint16(1418), + 72: uint16(1417), + 73: uint16(1526), + 74: uint16(1385), + 75: uint16(1411), + 76: uint16(1404), + 77: uint16(1408), + 78: uint16(1487), + 79: uint16(1488), + 80: uint16(1486), + 81: uint16(1641), + 82: uint16(1493), + 83: uint16(1492), + 84: uint16(1254), + 85: uint16(1407), + 86: uint16(1455), + 87: uint16(1471), + 88: uint16(1454), 89: uint16(1254), 90: uint16(1254), 91: uint16(1254), @@ -153412,49 +155683,49 @@ var _yy_default = [583]uint16{ 137: uint16(1254), 138: uint16(1254), 139: uint16(1254), - 140: uint16(1463), - 141: uint16(1470), - 142: uint16(1469), - 143: uint16(1468), - 144: uint16(1477), - 145: uint16(1467), - 146: uint16(1464), - 147: uint16(1457), - 148: uint16(1456), - 149: uint16(1458), - 150: uint16(1459), - 151: uint16(1278), - 152: uint16(1254), - 153: uint16(1275), - 154: uint16(1329), - 155: uint16(1254), - 156: uint16(1254), + 140: uint16(1254), + 141: uint16(1254), + 142: uint16(1463), + 143: uint16(1470), + 144: uint16(1469), + 145: uint16(1468), + 146: uint16(1477), + 147: uint16(1467), + 148: uint16(1464), + 149: uint16(1457), + 150: uint16(1456), + 151: uint16(1458), + 152: uint16(1459), + 153: uint16(1278), + 154: uint16(1254), + 155: uint16(1275), + 156: uint16(1329), 157: uint16(1254), 158: uint16(1254), 159: uint16(1254), - 160: uint16(1460), - 161: uint16(1287), - 162: uint16(1448), - 163: uint16(1447), - 164: uint16(1446), - 165: uint16(1254), - 166: uint16(1474), - 167: uint16(1461), - 168: uint16(1473), - 169: uint16(1472), - 170: uint16(1551), - 171: uint16(1615), - 172: uint16(1614), - 173: uint16(1509), - 174: uint16(1254), - 175: uint16(1254), + 160: uint16(1254), + 161: uint16(1254), + 162: uint16(1460), + 163: uint16(1287), + 164: uint16(1448), + 165: uint16(1447), + 166: uint16(1446), + 167: uint16(1254), + 168: uint16(1474), + 169: uint16(1461), + 170: uint16(1473), + 171: uint16(1472), + 172: uint16(1551), + 173: uint16(1615), + 174: uint16(1614), + 175: uint16(1509), 176: uint16(1254), 177: uint16(1254), 178: uint16(1254), 179: uint16(1254), - 180: uint16(1578), + 180: uint16(1254), 181: uint16(1254), - 182: uint16(1254), + 182: uint16(1578), 183: uint16(1254), 184: uint16(1254), 185: uint16(1254), @@ -153475,27 +155746,27 @@ var _yy_default = [583]uint16{ 200: uint16(1254), 201: uint16(1254), 202: uint16(1254), - 203: uint16(1387), - 204: uint16(1578), - 205: uint16(1578), - 206: uint16(1254), - 207: uint16(1287), - 208: uint16(1578), - 209: uint16(1578), - 210: uint16(1388), - 211: uint16(1388), - 212: uint16(1283), - 213: uint16(1283), - 214: uint16(1391), - 215: uint16(1558), - 216: uint16(1358), - 217: uint16(1358), + 203: uint16(1254), + 204: uint16(1254), + 205: uint16(1387), + 206: uint16(1578), + 207: uint16(1578), + 208: uint16(1254), + 209: uint16(1287), + 210: uint16(1578), + 211: uint16(1578), + 212: uint16(1388), + 213: uint16(1388), + 214: uint16(1283), + 215: uint16(1283), + 216: uint16(1391), + 217: uint16(1558), 218: uint16(1358), 219: uint16(1358), - 220: uint16(1367), + 220: uint16(1358), 221: uint16(1358), - 222: uint16(1254), - 223: uint16(1254), + 222: uint16(1367), + 223: uint16(1358), 224: uint16(1254), 225: uint16(1254), 226: uint16(1254), @@ -153509,10 +155780,10 @@ var _yy_default = [583]uint16{ 234: uint16(1254), 235: uint16(1254), 236: uint16(1254), - 237: uint16(1548), - 238: uint16(1546), - 239: uint16(1254), - 240: uint16(1254), + 237: uint16(1254), + 238: uint16(1254), + 239: uint16(1548), + 240: uint16(1546), 241: uint16(1254), 242: uint16(1254), 243: uint16(1254), @@ -153538,9 +155809,9 @@ var _yy_default = [583]uint16{ 263: uint16(1254), 264: uint16(1254), 265: uint16(1254), - 266: uint16(1363), + 266: uint16(1254), 267: uint16(1254), - 268: uint16(1254), + 268: uint16(1363), 269: uint16(1254), 270: uint16(1254), 271: uint16(1254), @@ -153550,152 +155821,152 @@ var _yy_default = [583]uint16{ 275: uint16(1254), 276: uint16(1254), 277: uint16(1254), - 278: uint16(1608), - 279: uint16(1254), - 280: uint16(1521), - 281: uint16(1343), - 282: uint16(1363), + 278: uint16(1254), + 279: uint16(1608), + 280: uint16(1254), + 281: uint16(1521), + 282: uint16(1343), 283: uint16(1363), 284: uint16(1363), 285: uint16(1363), - 286: uint16(1365), - 287: uint16(1344), - 288: uint16(1342), - 289: uint16(1357), - 290: uint16(1288), - 291: uint16(1261), - 292: uint16(1655), - 293: uint16(1423), - 294: uint16(1412), - 295: uint16(1364), - 296: uint16(1412), - 297: uint16(1652), - 298: uint16(1410), - 299: uint16(1423), + 286: uint16(1363), + 287: uint16(1365), + 288: uint16(1344), + 289: uint16(1342), + 290: uint16(1357), + 291: uint16(1288), + 292: uint16(1261), + 293: uint16(1655), + 294: uint16(1423), + 295: uint16(1412), + 296: uint16(1364), + 297: uint16(1412), + 298: uint16(1652), + 299: uint16(1410), 300: uint16(1423), - 301: uint16(1410), - 302: uint16(1423), - 303: uint16(1364), - 304: uint16(1652), - 305: uint16(1304), - 306: uint16(1630), - 307: uint16(1299), - 308: uint16(1397), + 301: uint16(1423), + 302: uint16(1410), + 303: uint16(1423), + 304: uint16(1364), + 305: uint16(1652), + 306: uint16(1304), + 307: uint16(1630), + 308: uint16(1299), 309: uint16(1397), 310: uint16(1397), - 311: uint16(1387), + 311: uint16(1397), 312: uint16(1387), 313: uint16(1387), 314: uint16(1387), - 315: uint16(1391), + 315: uint16(1387), 316: uint16(1391), - 317: uint16(1489), - 318: uint16(1364), - 319: uint16(1357), - 320: uint16(1254), - 321: uint16(1655), + 317: uint16(1391), + 318: uint16(1489), + 319: uint16(1364), + 320: uint16(1357), + 321: uint16(1254), 322: uint16(1655), - 323: uint16(1373), + 323: uint16(1655), 324: uint16(1373), - 325: uint16(1654), + 325: uint16(1373), 326: uint16(1654), - 327: uint16(1373), - 328: uint16(1509), - 329: uint16(1638), - 330: uint16(1432), - 331: uint16(1332), - 332: uint16(1338), + 327: uint16(1654), + 328: uint16(1373), + 329: uint16(1509), + 330: uint16(1638), + 331: uint16(1432), + 332: uint16(1332), 333: uint16(1338), 334: uint16(1338), 335: uint16(1338), - 336: uint16(1373), - 337: uint16(1272), - 338: uint16(1410), - 339: uint16(1638), + 336: uint16(1338), + 337: uint16(1373), + 338: uint16(1272), + 339: uint16(1410), 340: uint16(1638), - 341: uint16(1410), - 342: uint16(1432), - 343: uint16(1332), - 344: uint16(1410), - 345: uint16(1332), - 346: uint16(1410), - 347: uint16(1373), - 348: uint16(1272), - 349: uint16(1525), - 350: uint16(1649), - 351: uint16(1373), - 352: uint16(1272), - 353: uint16(1499), - 354: uint16(1373), - 355: uint16(1272), - 356: uint16(1373), - 357: uint16(1272), - 358: uint16(1499), - 359: uint16(1330), + 341: uint16(1638), + 342: uint16(1410), + 343: uint16(1432), + 344: uint16(1332), + 345: uint16(1410), + 346: uint16(1332), + 347: uint16(1410), + 348: uint16(1373), + 349: uint16(1272), + 350: uint16(1525), + 351: uint16(1649), + 352: uint16(1373), + 353: uint16(1272), + 354: uint16(1499), + 355: uint16(1373), + 356: uint16(1272), + 357: uint16(1373), + 358: uint16(1272), + 359: uint16(1499), 360: uint16(1330), 361: uint16(1330), - 362: uint16(1319), - 363: uint16(1254), + 362: uint16(1330), + 363: uint16(1319), 364: uint16(1254), - 365: uint16(1499), - 366: uint16(1330), - 367: uint16(1304), - 368: uint16(1330), - 369: uint16(1319), - 370: uint16(1330), + 365: uint16(1254), + 366: uint16(1499), + 367: uint16(1330), + 368: uint16(1304), + 369: uint16(1330), + 370: uint16(1319), 371: uint16(1330), - 372: uint16(1596), - 373: uint16(1254), - 374: uint16(1503), + 372: uint16(1330), + 373: uint16(1596), + 374: uint16(1254), 375: uint16(1503), - 376: uint16(1499), - 377: uint16(1373), - 378: uint16(1588), + 376: uint16(1503), + 377: uint16(1499), + 378: uint16(1373), 379: uint16(1588), - 380: uint16(1400), + 380: uint16(1588), 381: uint16(1400), - 382: uint16(1405), - 383: uint16(1391), - 384: uint16(1494), - 385: uint16(1373), - 386: uint16(1254), - 387: uint16(1405), - 388: uint16(1403), - 389: uint16(1401), - 390: uint16(1410), - 391: uint16(1322), - 392: uint16(1611), + 382: uint16(1400), + 383: uint16(1405), + 384: uint16(1391), + 385: uint16(1494), + 386: uint16(1373), + 387: uint16(1254), + 388: uint16(1405), + 389: uint16(1403), + 390: uint16(1401), + 391: uint16(1410), + 392: uint16(1322), 393: uint16(1611), - 394: uint16(1607), + 394: uint16(1611), 395: uint16(1607), 396: uint16(1607), - 397: uint16(1660), + 397: uint16(1607), 398: uint16(1660), - 399: uint16(1558), - 400: uint16(1623), - 401: uint16(1287), + 399: uint16(1660), + 400: uint16(1558), + 401: uint16(1623), 402: uint16(1287), 403: uint16(1287), 404: uint16(1287), - 405: uint16(1623), - 406: uint16(1306), + 405: uint16(1287), + 406: uint16(1623), 407: uint16(1306), - 408: uint16(1288), + 408: uint16(1306), 409: uint16(1288), - 410: uint16(1287), - 411: uint16(1623), - 412: uint16(1254), + 410: uint16(1288), + 411: uint16(1287), + 412: uint16(1623), 413: uint16(1254), 414: uint16(1254), 415: uint16(1254), 416: uint16(1254), 417: uint16(1254), - 418: uint16(1618), - 419: uint16(1254), - 420: uint16(1553), - 421: uint16(1510), - 422: uint16(1377), - 423: uint16(1254), + 418: uint16(1254), + 419: uint16(1618), + 420: uint16(1254), + 421: uint16(1553), + 422: uint16(1510), + 423: uint16(1377), 424: uint16(1254), 425: uint16(1254), 426: uint16(1254), @@ -153711,8 +155982,8 @@ var _yy_default = [583]uint16{ 436: uint16(1254), 437: uint16(1254), 438: uint16(1254), - 439: uint16(1564), - 440: uint16(1254), + 439: uint16(1254), + 440: uint16(1564), 441: uint16(1254), 442: uint16(1254), 443: uint16(1254), @@ -153723,11 +155994,11 @@ var _yy_default = [583]uint16{ 448: uint16(1254), 449: uint16(1254), 450: uint16(1254), - 451: uint16(1437), - 452: uint16(1254), - 453: uint16(1257), - 454: uint16(1555), - 455: uint16(1254), + 451: uint16(1254), + 452: uint16(1437), + 453: uint16(1254), + 454: uint16(1257), + 455: uint16(1555), 456: uint16(1254), 457: uint16(1254), 458: uint16(1254), @@ -153735,22 +156006,22 @@ var _yy_default = [583]uint16{ 460: uint16(1254), 461: uint16(1254), 462: uint16(1254), - 463: uint16(1414), - 464: uint16(1415), - 465: uint16(1378), - 466: uint16(1254), + 463: uint16(1254), + 464: uint16(1414), + 465: uint16(1415), + 466: uint16(1378), 467: uint16(1254), 468: uint16(1254), 469: uint16(1254), 470: uint16(1254), 471: uint16(1254), 472: uint16(1254), - 473: uint16(1429), - 474: uint16(1254), + 473: uint16(1254), + 474: uint16(1429), 475: uint16(1254), 476: uint16(1254), - 477: uint16(1424), - 478: uint16(1254), + 477: uint16(1254), + 478: uint16(1424), 479: uint16(1254), 480: uint16(1254), 481: uint16(1254), @@ -153758,19 +156029,19 @@ var _yy_default = [583]uint16{ 483: uint16(1254), 484: uint16(1254), 485: uint16(1254), - 486: uint16(1651), - 487: uint16(1254), + 486: uint16(1254), + 487: uint16(1651), 488: uint16(1254), 489: uint16(1254), 490: uint16(1254), 491: uint16(1254), 492: uint16(1254), - 493: uint16(1524), - 494: uint16(1523), - 495: uint16(1254), + 493: uint16(1254), + 494: uint16(1524), + 495: uint16(1523), 496: uint16(1254), - 497: uint16(1375), - 498: uint16(1254), + 497: uint16(1254), + 498: uint16(1375), 499: uint16(1254), 500: uint16(1254), 501: uint16(1254), @@ -153783,8 +156054,8 @@ var _yy_default = [583]uint16{ 508: uint16(1254), 509: uint16(1254), 510: uint16(1254), - 511: uint16(1302), - 512: uint16(1254), + 511: uint16(1254), + 512: uint16(1302), 513: uint16(1254), 514: uint16(1254), 515: uint16(1254), @@ -153807,8 +156078,8 @@ var _yy_default = [583]uint16{ 532: uint16(1254), 533: uint16(1254), 534: uint16(1254), - 535: uint16(1402), - 536: uint16(1254), + 535: uint16(1254), + 536: uint16(1402), 537: uint16(1254), 538: uint16(1254), 539: uint16(1254), @@ -153822,19 +156093,19 @@ var _yy_default = [583]uint16{ 547: uint16(1254), 548: uint16(1254), 549: uint16(1254), - 550: uint16(1593), - 551: uint16(1392), - 552: uint16(1254), + 550: uint16(1254), + 551: uint16(1593), + 552: uint16(1392), 553: uint16(1254), 554: uint16(1254), 555: uint16(1254), - 556: uint16(1642), - 557: uint16(1254), + 556: uint16(1254), + 557: uint16(1642), 558: uint16(1254), 559: uint16(1254), 560: uint16(1254), - 561: uint16(1352), - 562: uint16(1254), + 561: uint16(1254), + 562: uint16(1352), 563: uint16(1254), 564: uint16(1254), 565: uint16(1254), @@ -153875,80 +156146,80 @@ var _yy_default = [583]uint16{ // ** to revert to identifiers if they keyword does not apply in the context where // ** it appears. // */ -var _yyFallback = [186]uint16{ - 2: uint16(59), - 3: uint16(59), - 4: uint16(59), - 5: uint16(59), - 7: uint16(59), - 8: uint16(59), - 9: uint16(59), - 11: uint16(59), - 12: uint16(59), - 13: uint16(59), - 14: uint16(59), - 18: uint16(59), - 21: uint16(59), - 26: uint16(59), - 27: uint16(59), - 28: uint16(59), - 29: uint16(59), - 30: uint16(59), - 31: uint16(59), - 32: uint16(59), - 33: uint16(59), - 34: uint16(59), - 35: uint16(59), - 36: uint16(59), - 37: uint16(59), - 38: uint16(59), - 39: uint16(59), - 40: uint16(59), - 41: uint16(59), - 42: uint16(59), - 46: uint16(59), - 47: uint16(59), - 60: uint16(59), - 61: uint16(59), - 62: uint16(59), - 63: uint16(59), - 64: uint16(59), - 65: uint16(59), - 66: uint16(59), - 67: uint16(59), - 68: uint16(59), - 69: uint16(59), - 70: uint16(59), - 71: uint16(59), - 72: uint16(59), - 73: uint16(59), - 74: uint16(59), - 75: uint16(59), - 76: uint16(59), - 77: uint16(59), - 78: uint16(59), - 79: uint16(59), - 80: uint16(59), - 81: uint16(59), - 82: uint16(59), - 83: uint16(59), - 84: uint16(59), - 85: uint16(59), - 86: uint16(59), - 87: uint16(59), - 88: uint16(59), - 89: uint16(59), - 90: uint16(59), - 91: uint16(59), - 92: uint16(59), - 93: uint16(59), - 94: uint16(59), - 95: uint16(59), - 96: uint16(59), - 97: uint16(59), - 98: uint16(59), - 99: uint16(59), - 100: uint16(59), +var _yyFallback = [187]uint16{ + 2: uint16(60), + 3: uint16(60), + 4: uint16(60), + 5: uint16(60), + 7: uint16(60), + 8: uint16(60), + 9: uint16(60), + 11: uint16(60), + 12: uint16(60), + 13: uint16(60), + 14: uint16(60), + 18: uint16(60), + 21: uint16(60), + 26: uint16(60), + 27: uint16(60), + 28: uint16(60), + 29: uint16(60), + 30: uint16(60), + 31: uint16(60), + 32: uint16(60), + 33: uint16(60), + 34: uint16(60), + 35: uint16(60), + 36: uint16(60), + 37: uint16(60), + 38: uint16(60), + 39: uint16(60), + 40: uint16(60), + 41: uint16(60), + 42: uint16(60), + 47: uint16(60), + 48: uint16(60), + 61: uint16(60), + 62: uint16(60), + 63: uint16(60), + 64: uint16(60), + 65: uint16(60), + 66: uint16(60), + 67: uint16(60), + 68: uint16(60), + 69: uint16(60), + 70: uint16(60), + 71: uint16(60), + 72: uint16(60), + 73: uint16(60), + 74: uint16(60), + 75: uint16(60), + 76: uint16(60), + 77: uint16(60), + 78: uint16(60), + 79: uint16(60), + 80: uint16(60), + 81: uint16(60), + 82: uint16(60), + 83: uint16(60), + 84: uint16(60), + 85: uint16(60), + 86: uint16(60), + 87: uint16(60), + 88: uint16(60), + 89: uint16(60), + 90: uint16(60), + 91: uint16(60), + 92: uint16(60), + 93: uint16(60), + 94: uint16(60), + 95: uint16(60), + 96: uint16(60), + 97: uint16(60), + 98: uint16(60), + 99: uint16(60), + 100: uint16(60), + 101: uint16(60), } /* The following structure represents a single element of the @@ -154085,105 +156356,105 @@ func _yy_destructor(tls *libc.TLS, yypParser uintptr, yymajor uint16, yypminor u ** inside the C code. */ /********* Begin destructor definitions ***************************************/ - case int32(205): /* select */ + case int32(206): /* select */ fallthrough - case int32(240): /* selectnowith */ + case int32(241): /* selectnowith */ fallthrough - case int32(241): /* oneselect */ + case int32(242): /* oneselect */ fallthrough - case int32(253): /* values */ + case int32(254): /* values */ fallthrough - case int32(255): /* mvalues */ + case int32(256): /* mvalues */ _sqlite3SelectDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor))) - case int32(217): /* term */ + case int32(218): /* term */ fallthrough - case int32(218): /* expr */ + case int32(219): /* expr */ fallthrough - case int32(247): /* where_opt */ + case int32(248): /* where_opt */ fallthrough - case int32(249): /* having_opt */ + case int32(250): /* having_opt */ fallthrough - case int32(269): /* where_opt_ret */ + case int32(270): /* where_opt_ret */ fallthrough - case int32(280): /* case_operand */ + case int32(281): /* case_operand */ fallthrough - case int32(282): /* case_else */ + case int32(283): /* case_else */ fallthrough - case int32(285): /* vinto */ + case int32(286): /* vinto */ fallthrough - case int32(292): /* when_clause */ + case int32(293): /* when_clause */ fallthrough - case int32(297): /* key_opt */ + case int32(298): /* key_opt */ fallthrough - case int32(314): /* filter_clause */ + case int32(315): /* filter_clause */ _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor))) - case int32(222): /* eidlist_opt */ + case int32(223): /* eidlist_opt */ fallthrough - case int32(232): /* sortlist */ + case int32(233): /* sortlist */ fallthrough - case int32(233): /* eidlist */ + case int32(234): /* eidlist */ fallthrough - case int32(245): /* selcollist */ + case int32(246): /* selcollist */ fallthrough - case int32(248): /* groupby_opt */ + case int32(249): /* groupby_opt */ fallthrough - case int32(250): /* orderby_opt */ + case int32(251): /* orderby_opt */ fallthrough - case int32(254): /* nexprlist */ + case int32(255): /* nexprlist */ fallthrough - case int32(256): /* sclp */ + case int32(257): /* sclp */ fallthrough - case int32(263): /* exprlist */ + case int32(264): /* exprlist */ fallthrough - case int32(270): /* setlist */ + case int32(271): /* setlist */ fallthrough - case int32(279): /* paren_exprlist */ + case int32(280): /* paren_exprlist */ fallthrough - case int32(281): /* case_exprlist */ + case int32(282): /* case_exprlist */ fallthrough - case int32(313): /* part_opt */ + case int32(314): /* part_opt */ _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor))) - case int32(239): /* fullname */ + case int32(240): /* fullname */ fallthrough - case int32(246): /* from */ + case int32(247): /* from */ fallthrough - case int32(258): /* seltablist */ + case int32(259): /* seltablist */ fallthrough - case int32(259): /* stl_prefix */ + case int32(260): /* stl_prefix */ fallthrough - case int32(264): /* xfullname */ + case int32(265): /* xfullname */ _sqlite3SrcListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor))) - case int32(242): /* wqlist */ + case int32(243): /* wqlist */ _sqlite3WithDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor))) - case int32(252): /* window_clause */ + case int32(253): /* window_clause */ fallthrough - case int32(309): /* windowdefn_list */ + case int32(310): /* windowdefn_list */ _sqlite3WindowListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor))) - case int32(265): /* idlist */ + case int32(266): /* idlist */ fallthrough - case int32(272): /* idlist_opt */ + case int32(273): /* idlist_opt */ _sqlite3IdListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor))) - case int32(275): /* filter_over */ + case int32(276): /* filter_over */ fallthrough - case int32(310): /* windowdefn */ + case int32(311): /* windowdefn */ fallthrough - case int32(311): /* window */ + case int32(312): /* window */ fallthrough - case int32(312): /* frame_opt */ + case int32(313): /* frame_opt */ fallthrough - case int32(315): /* over_clause */ + case int32(316): /* over_clause */ _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor))) - case int32(288): /* trigger_cmd_list */ + case int32(289): /* trigger_cmd_list */ fallthrough - case int32(293): /* trigger_cmd */ + case int32(294): /* trigger_cmd */ _sqlite3DeleteTriggerStep(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yypminor))) - case int32(290): /* trigger_event */ + case int32(291): /* trigger_event */ _sqlite3IdListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*(*TTrigEvent)(unsafe.Pointer(yypminor))).Fb) - case int32(317): /* frame_bound */ + case int32(318): /* frame_bound */ fallthrough - case int32(318): /* frame_bound_s */ + case int32(319): /* frame_bound_s */ fallthrough - case int32(319): /* frame_bound_e */ + case int32(320): /* frame_bound_e */ _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*(*TFrameBound)(unsafe.Pointer(yypminor))).FpExpr) break /********* End destructor definitions *****************************************/ @@ -154358,415 +156629,415 @@ func _yy_shift(tls *libc.TLS, yypParser uintptr, yyNewState uint16, yyMajor uint // /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side // ** of that rule */ var _yyRuleInfoLhs = [409]uint16{ - 0: uint16(190), - 1: uint16(190), - 2: uint16(189), - 3: uint16(191), - 4: uint16(192), - 5: uint16(192), - 6: uint16(192), - 7: uint16(192), - 8: uint16(191), - 9: uint16(191), - 10: uint16(191), - 11: uint16(191), - 12: uint16(191), - 13: uint16(196), - 14: uint16(198), - 15: uint16(200), - 16: uint16(200), - 17: uint16(199), - 18: uint16(199), - 19: uint16(197), - 20: uint16(197), - 21: uint16(204), - 22: uint16(204), - 23: uint16(206), - 24: uint16(206), - 25: uint16(207), - 26: uint16(209), - 27: uint16(209), - 28: uint16(209), - 29: uint16(210), - 30: uint16(214), - 31: uint16(215), - 32: uint16(216), - 33: uint16(216), - 34: uint16(216), - 35: uint16(216), - 36: uint16(216), - 37: uint16(216), - 38: uint16(216), - 39: uint16(216), - 40: uint16(216), - 41: uint16(216), - 42: uint16(216), - 43: uint16(216), - 44: uint16(216), - 45: uint16(225), - 46: uint16(225), - 47: uint16(221), - 48: uint16(221), - 49: uint16(223), - 50: uint16(223), - 51: uint16(226), - 52: uint16(226), - 53: uint16(226), - 54: uint16(226), - 55: uint16(227), - 56: uint16(227), - 57: uint16(227), - 58: uint16(227), - 59: uint16(227), - 60: uint16(224), - 61: uint16(224), - 62: uint16(228), - 63: uint16(228), - 64: uint16(228), - 65: uint16(203), - 66: uint16(230), - 67: uint16(231), - 68: uint16(231), - 69: uint16(231), - 70: uint16(231), - 71: uint16(231), - 72: uint16(234), - 73: uint16(219), - 74: uint16(219), - 75: uint16(235), - 76: uint16(235), - 77: uint16(236), - 78: uint16(236), - 79: uint16(191), - 80: uint16(238), - 81: uint16(238), - 82: uint16(191), - 83: uint16(191), - 84: uint16(191), - 85: uint16(205), - 86: uint16(205), - 87: uint16(205), - 88: uint16(240), - 89: uint16(243), - 90: uint16(243), - 91: uint16(243), - 92: uint16(241), - 93: uint16(241), - 94: uint16(253), - 95: uint16(241), - 96: uint16(255), - 97: uint16(255), - 98: uint16(244), - 99: uint16(244), - 100: uint16(244), - 101: uint16(256), - 102: uint16(245), - 103: uint16(245), - 104: uint16(245), - 105: uint16(257), - 106: uint16(257), - 107: uint16(246), - 108: uint16(246), - 109: uint16(259), - 110: uint16(259), - 111: uint16(258), - 112: uint16(258), - 113: uint16(258), - 114: uint16(258), - 115: uint16(258), - 116: uint16(201), - 117: uint16(201), - 118: uint16(239), - 119: uint16(239), - 120: uint16(264), - 121: uint16(264), - 122: uint16(264), - 123: uint16(264), - 124: uint16(260), - 125: uint16(260), - 126: uint16(260), - 127: uint16(260), - 128: uint16(261), - 129: uint16(261), - 130: uint16(261), - 131: uint16(266), - 132: uint16(262), - 133: uint16(262), - 134: uint16(250), - 135: uint16(250), - 136: uint16(232), - 137: uint16(232), - 138: uint16(220), - 139: uint16(220), - 140: uint16(220), - 141: uint16(267), - 142: uint16(267), - 143: uint16(267), - 144: uint16(248), - 145: uint16(248), - 146: uint16(249), - 147: uint16(249), - 148: uint16(251), - 149: uint16(251), - 150: uint16(251), - 151: uint16(251), - 152: uint16(191), - 153: uint16(247), - 154: uint16(247), - 155: uint16(269), - 156: uint16(269), - 157: uint16(269), - 158: uint16(269), - 159: uint16(191), - 160: uint16(270), - 161: uint16(270), - 162: uint16(270), - 163: uint16(270), - 164: uint16(191), - 165: uint16(191), - 166: uint16(273), - 167: uint16(273), - 168: uint16(273), - 169: uint16(273), - 170: uint16(273), - 171: uint16(273), - 172: uint16(274), - 173: uint16(271), - 174: uint16(271), - 175: uint16(272), - 176: uint16(272), - 177: uint16(265), - 178: uint16(265), - 179: uint16(218), - 180: uint16(218), - 181: uint16(218), - 182: uint16(218), - 183: uint16(217), - 184: uint16(217), - 185: uint16(217), - 186: uint16(218), - 187: uint16(218), - 188: uint16(218), - 189: uint16(218), - 190: uint16(218), - 191: uint16(218), - 192: uint16(218), - 193: uint16(218), - 194: uint16(218), - 195: uint16(217), - 196: uint16(218), - 197: uint16(218), - 198: uint16(218), - 199: uint16(218), - 200: uint16(218), - 201: uint16(218), - 202: uint16(218), - 203: uint16(218), - 204: uint16(218), - 205: uint16(276), - 206: uint16(218), - 207: uint16(218), - 208: uint16(218), - 209: uint16(218), - 210: uint16(218), - 211: uint16(218), - 212: uint16(218), - 213: uint16(218), - 214: uint16(218), - 215: uint16(218), - 216: uint16(218), - 217: uint16(218), - 218: uint16(277), - 219: uint16(277), - 220: uint16(218), - 221: uint16(278), - 222: uint16(278), - 223: uint16(218), - 224: uint16(218), - 225: uint16(218), - 226: uint16(218), - 227: uint16(218), - 228: uint16(218), - 229: uint16(281), - 230: uint16(281), - 231: uint16(282), - 232: uint16(282), - 233: uint16(280), - 234: uint16(263), - 235: uint16(254), - 236: uint16(254), - 237: uint16(279), - 238: uint16(279), - 239: uint16(191), - 240: uint16(283), - 241: uint16(283), - 242: uint16(222), - 243: uint16(222), - 244: uint16(233), - 245: uint16(233), - 246: uint16(284), - 247: uint16(284), - 248: uint16(191), - 249: uint16(191), - 250: uint16(191), - 251: uint16(285), - 252: uint16(285), - 253: uint16(191), - 254: uint16(191), - 255: uint16(191), - 256: uint16(191), - 257: uint16(191), - 258: uint16(212), - 259: uint16(213), - 260: uint16(191), - 261: uint16(287), - 262: uint16(289), - 263: uint16(289), - 264: uint16(289), - 265: uint16(290), - 266: uint16(290), - 267: uint16(290), - 268: uint16(292), - 269: uint16(292), - 270: uint16(288), - 271: uint16(288), - 272: uint16(294), - 273: uint16(295), - 274: uint16(295), - 275: uint16(293), - 276: uint16(293), - 277: uint16(293), - 278: uint16(293), - 279: uint16(218), - 280: uint16(218), - 281: uint16(237), - 282: uint16(237), - 283: uint16(237), - 284: uint16(191), - 285: uint16(191), - 286: uint16(191), - 287: uint16(297), - 288: uint16(297), - 289: uint16(191), - 290: uint16(191), - 291: uint16(191), - 292: uint16(191), - 293: uint16(191), - 294: uint16(191), - 295: uint16(191), - 296: uint16(298), - 297: uint16(191), - 298: uint16(191), - 299: uint16(191), - 300: uint16(300), - 301: uint16(302), - 302: uint16(303), - 303: uint16(303), - 304: uint16(304), - 305: uint16(268), - 306: uint16(268), - 307: uint16(307), - 308: uint16(307), - 309: uint16(307), - 310: uint16(306), - 311: uint16(308), - 312: uint16(242), - 313: uint16(242), - 314: uint16(309), - 315: uint16(310), - 316: uint16(311), - 317: uint16(311), - 318: uint16(311), - 319: uint16(311), - 320: uint16(311), - 321: uint16(312), - 322: uint16(312), - 323: uint16(312), - 324: uint16(316), - 325: uint16(318), - 326: uint16(318), - 327: uint16(319), - 328: uint16(319), - 329: uint16(317), - 330: uint16(317), - 331: uint16(320), - 332: uint16(320), - 333: uint16(321), - 334: uint16(321), - 335: uint16(321), - 336: uint16(252), - 337: uint16(275), - 338: uint16(275), - 339: uint16(275), - 340: uint16(315), - 341: uint16(315), - 342: uint16(314), - 343: uint16(217), - 344: uint16(186), - 345: uint16(187), - 346: uint16(187), - 347: uint16(188), - 348: uint16(188), - 349: uint16(188), - 350: uint16(193), - 351: uint16(193), - 352: uint16(193), - 353: uint16(195), - 354: uint16(195), - 355: uint16(191), - 356: uint16(204), - 357: uint16(202), - 358: uint16(202), - 359: uint16(194), - 360: uint16(194), - 361: uint16(209), - 362: uint16(210), - 363: uint16(211), - 364: uint16(211), - 365: uint16(208), - 366: uint16(208), - 367: uint16(216), - 368: uint16(216), - 369: uint16(216), - 370: uint16(203), - 371: uint16(229), - 372: uint16(229), - 373: uint16(230), - 374: uint16(234), - 375: uint16(236), - 376: uint16(240), - 377: uint16(241), - 378: uint16(256), - 379: uint16(257), - 380: uint16(266), - 381: uint16(274), - 382: uint16(218), - 383: uint16(276), - 384: uint16(280), - 385: uint16(263), - 386: uint16(286), - 387: uint16(286), - 388: uint16(286), - 389: uint16(286), - 390: uint16(286), - 391: uint16(212), - 392: uint16(291), - 393: uint16(291), - 394: uint16(294), - 395: uint16(295), - 396: uint16(296), - 397: uint16(296), - 398: uint16(299), - 399: uint16(299), - 400: uint16(301), - 401: uint16(301), - 402: uint16(302), - 403: uint16(305), - 404: uint16(305), - 405: uint16(305), - 406: uint16(268), - 407: uint16(309), - 408: uint16(311), + 0: uint16(191), + 1: uint16(191), + 2: uint16(190), + 3: uint16(192), + 4: uint16(193), + 5: uint16(193), + 6: uint16(193), + 7: uint16(193), + 8: uint16(192), + 9: uint16(192), + 10: uint16(192), + 11: uint16(192), + 12: uint16(192), + 13: uint16(197), + 14: uint16(199), + 15: uint16(201), + 16: uint16(201), + 17: uint16(200), + 18: uint16(200), + 19: uint16(198), + 20: uint16(198), + 21: uint16(205), + 22: uint16(205), + 23: uint16(207), + 24: uint16(207), + 25: uint16(208), + 26: uint16(210), + 27: uint16(210), + 28: uint16(210), + 29: uint16(211), + 30: uint16(215), + 31: uint16(216), + 32: uint16(217), + 33: uint16(217), + 34: uint16(217), + 35: uint16(217), + 36: uint16(217), + 37: uint16(217), + 38: uint16(217), + 39: uint16(217), + 40: uint16(217), + 41: uint16(217), + 42: uint16(217), + 43: uint16(217), + 44: uint16(217), + 45: uint16(226), + 46: uint16(226), + 47: uint16(222), + 48: uint16(222), + 49: uint16(224), + 50: uint16(224), + 51: uint16(227), + 52: uint16(227), + 53: uint16(227), + 54: uint16(227), + 55: uint16(228), + 56: uint16(228), + 57: uint16(228), + 58: uint16(228), + 59: uint16(228), + 60: uint16(225), + 61: uint16(225), + 62: uint16(229), + 63: uint16(229), + 64: uint16(229), + 65: uint16(204), + 66: uint16(231), + 67: uint16(232), + 68: uint16(232), + 69: uint16(232), + 70: uint16(232), + 71: uint16(232), + 72: uint16(235), + 73: uint16(220), + 74: uint16(220), + 75: uint16(236), + 76: uint16(236), + 77: uint16(237), + 78: uint16(237), + 79: uint16(192), + 80: uint16(239), + 81: uint16(239), + 82: uint16(192), + 83: uint16(192), + 84: uint16(192), + 85: uint16(206), + 86: uint16(206), + 87: uint16(206), + 88: uint16(241), + 89: uint16(244), + 90: uint16(244), + 91: uint16(244), + 92: uint16(242), + 93: uint16(242), + 94: uint16(254), + 95: uint16(242), + 96: uint16(256), + 97: uint16(256), + 98: uint16(245), + 99: uint16(245), + 100: uint16(245), + 101: uint16(257), + 102: uint16(246), + 103: uint16(246), + 104: uint16(246), + 105: uint16(258), + 106: uint16(258), + 107: uint16(247), + 108: uint16(247), + 109: uint16(260), + 110: uint16(260), + 111: uint16(259), + 112: uint16(259), + 113: uint16(259), + 114: uint16(259), + 115: uint16(259), + 116: uint16(202), + 117: uint16(202), + 118: uint16(240), + 119: uint16(240), + 120: uint16(265), + 121: uint16(265), + 122: uint16(265), + 123: uint16(265), + 124: uint16(261), + 125: uint16(261), + 126: uint16(261), + 127: uint16(261), + 128: uint16(262), + 129: uint16(262), + 130: uint16(262), + 131: uint16(267), + 132: uint16(263), + 133: uint16(263), + 134: uint16(251), + 135: uint16(251), + 136: uint16(233), + 137: uint16(233), + 138: uint16(221), + 139: uint16(221), + 140: uint16(221), + 141: uint16(268), + 142: uint16(268), + 143: uint16(268), + 144: uint16(249), + 145: uint16(249), + 146: uint16(250), + 147: uint16(250), + 148: uint16(252), + 149: uint16(252), + 150: uint16(252), + 151: uint16(252), + 152: uint16(192), + 153: uint16(248), + 154: uint16(248), + 155: uint16(270), + 156: uint16(270), + 157: uint16(270), + 158: uint16(270), + 159: uint16(192), + 160: uint16(271), + 161: uint16(271), + 162: uint16(271), + 163: uint16(271), + 164: uint16(192), + 165: uint16(192), + 166: uint16(274), + 167: uint16(274), + 168: uint16(274), + 169: uint16(274), + 170: uint16(274), + 171: uint16(274), + 172: uint16(275), + 173: uint16(272), + 174: uint16(272), + 175: uint16(273), + 176: uint16(273), + 177: uint16(266), + 178: uint16(266), + 179: uint16(219), + 180: uint16(219), + 181: uint16(219), + 182: uint16(219), + 183: uint16(218), + 184: uint16(218), + 185: uint16(218), + 186: uint16(219), + 187: uint16(219), + 188: uint16(219), + 189: uint16(219), + 190: uint16(219), + 191: uint16(219), + 192: uint16(219), + 193: uint16(219), + 194: uint16(219), + 195: uint16(218), + 196: uint16(219), + 197: uint16(219), + 198: uint16(219), + 199: uint16(219), + 200: uint16(219), + 201: uint16(219), + 202: uint16(219), + 203: uint16(219), + 204: uint16(219), + 205: uint16(277), + 206: uint16(219), + 207: uint16(219), + 208: uint16(219), + 209: uint16(219), + 210: uint16(219), + 211: uint16(219), + 212: uint16(219), + 213: uint16(219), + 214: uint16(219), + 215: uint16(219), + 216: uint16(219), + 217: uint16(219), + 218: uint16(278), + 219: uint16(278), + 220: uint16(219), + 221: uint16(279), + 222: uint16(279), + 223: uint16(219), + 224: uint16(219), + 225: uint16(219), + 226: uint16(219), + 227: uint16(219), + 228: uint16(219), + 229: uint16(282), + 230: uint16(282), + 231: uint16(283), + 232: uint16(283), + 233: uint16(281), + 234: uint16(264), + 235: uint16(255), + 236: uint16(255), + 237: uint16(280), + 238: uint16(280), + 239: uint16(192), + 240: uint16(284), + 241: uint16(284), + 242: uint16(223), + 243: uint16(223), + 244: uint16(234), + 245: uint16(234), + 246: uint16(285), + 247: uint16(285), + 248: uint16(192), + 249: uint16(192), + 250: uint16(192), + 251: uint16(286), + 252: uint16(286), + 253: uint16(192), + 254: uint16(192), + 255: uint16(192), + 256: uint16(192), + 257: uint16(192), + 258: uint16(213), + 259: uint16(214), + 260: uint16(192), + 261: uint16(288), + 262: uint16(290), + 263: uint16(290), + 264: uint16(290), + 265: uint16(291), + 266: uint16(291), + 267: uint16(291), + 268: uint16(293), + 269: uint16(293), + 270: uint16(289), + 271: uint16(289), + 272: uint16(295), + 273: uint16(296), + 274: uint16(296), + 275: uint16(294), + 276: uint16(294), + 277: uint16(294), + 278: uint16(294), + 279: uint16(219), + 280: uint16(219), + 281: uint16(238), + 282: uint16(238), + 283: uint16(238), + 284: uint16(192), + 285: uint16(192), + 286: uint16(192), + 287: uint16(298), + 288: uint16(298), + 289: uint16(192), + 290: uint16(192), + 291: uint16(192), + 292: uint16(192), + 293: uint16(192), + 294: uint16(192), + 295: uint16(192), + 296: uint16(299), + 297: uint16(192), + 298: uint16(192), + 299: uint16(192), + 300: uint16(301), + 301: uint16(303), + 302: uint16(304), + 303: uint16(304), + 304: uint16(305), + 305: uint16(269), + 306: uint16(269), + 307: uint16(308), + 308: uint16(308), + 309: uint16(308), + 310: uint16(307), + 311: uint16(309), + 312: uint16(243), + 313: uint16(243), + 314: uint16(310), + 315: uint16(311), + 316: uint16(312), + 317: uint16(312), + 318: uint16(312), + 319: uint16(312), + 320: uint16(312), + 321: uint16(313), + 322: uint16(313), + 323: uint16(313), + 324: uint16(317), + 325: uint16(319), + 326: uint16(319), + 327: uint16(320), + 328: uint16(320), + 329: uint16(318), + 330: uint16(318), + 331: uint16(321), + 332: uint16(321), + 333: uint16(322), + 334: uint16(322), + 335: uint16(322), + 336: uint16(253), + 337: uint16(276), + 338: uint16(276), + 339: uint16(276), + 340: uint16(316), + 341: uint16(316), + 342: uint16(315), + 343: uint16(218), + 344: uint16(187), + 345: uint16(188), + 346: uint16(188), + 347: uint16(189), + 348: uint16(189), + 349: uint16(189), + 350: uint16(194), + 351: uint16(194), + 352: uint16(194), + 353: uint16(196), + 354: uint16(196), + 355: uint16(192), + 356: uint16(205), + 357: uint16(203), + 358: uint16(203), + 359: uint16(195), + 360: uint16(195), + 361: uint16(210), + 362: uint16(211), + 363: uint16(212), + 364: uint16(212), + 365: uint16(209), + 366: uint16(209), + 367: uint16(217), + 368: uint16(217), + 369: uint16(217), + 370: uint16(204), + 371: uint16(230), + 372: uint16(230), + 373: uint16(231), + 374: uint16(235), + 375: uint16(237), + 376: uint16(241), + 377: uint16(242), + 378: uint16(257), + 379: uint16(258), + 380: uint16(267), + 381: uint16(275), + 382: uint16(219), + 383: uint16(277), + 384: uint16(281), + 385: uint16(264), + 386: uint16(287), + 387: uint16(287), + 388: uint16(287), + 389: uint16(287), + 390: uint16(287), + 391: uint16(213), + 392: uint16(292), + 393: uint16(292), + 394: uint16(295), + 395: uint16(296), + 396: uint16(297), + 397: uint16(297), + 398: uint16(300), + 399: uint16(300), + 400: uint16(302), + 401: uint16(302), + 402: uint16(303), + 403: uint16(306), + 404: uint16(306), + 405: uint16(306), + 406: uint16(269), + 407: uint16(310), + 408: uint16(312), } // C documentation @@ -155145,16 +157416,16 @@ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead i var bNot, bNot1, nExpr, yygoto, yysize int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350, v351 uintptr + var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr var yyact uint16 - var v352 TToken + var v351 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -155957,20 +158228,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16781, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16846, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23510, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23615, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16694, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16759, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23510, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23615, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -156212,7 +158483,9 @@ _94: *(*TSelectDest)(unsafe.Pointer(bp + 16)) = TSelectDest{ FeDest: uint8(SRT_Output), } - _sqlite3Select(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), bp+16) + if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_EncodingFixed) != uint32(0) || _sqlite3ReadSchema(tls, pParse) == SQLITE_OK { + _sqlite3Select(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + 8)), bp+16) + } _sqlite3SelectDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + 8))) goto _346 _95: @@ -156360,7 +158633,7 @@ _125: _126: ; /* stl_prefix ::= seltablist joinop */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 && (*TSrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)))).FnSrc > 0 { - (*(*TSrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8 + uintptr((*TSrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)))).FnSrc-int32(1))*104))).Ffg.Fjointype = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + 8))) + (*(*TSrcItem)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8 + uintptr((*TSrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)))).FnSrc-int32(1))*80))).Ffg.Fjointype = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + 8))) } goto _346 _127: @@ -156389,24 +158662,28 @@ _131: if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != uintptr(0) && (*TSrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)))).FnSrc == int32(1) { *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)) = _sqlite3SrcListAppendFromTerm(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), uintptr(0), uintptr(0), yymsp+uintptr(-libc.Int32FromInt32(1))*24+8, uintptr(0), yymsp+8) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)) != 0 { - pNew = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)) + 8 + uintptr((*TSrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)))).FnSrc-int32(1))*104 + pNew = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)) + 8 + uintptr((*TSrcList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)))).FnSrc-int32(1))*80 pOld = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) + 8 (*TSrcItem)(unsafe.Pointer(pNew)).FzName = (*TSrcItem)(unsafe.Pointer(pOld)).FzName - (*TSrcItem)(unsafe.Pointer(pNew)).FzDatabase = (*TSrcItem)(unsafe.Pointer(pOld)).FzDatabase - (*TSrcItem)(unsafe.Pointer(pNew)).FpSelect = (*TSrcItem)(unsafe.Pointer(pOld)).FpSelect - if (*TSrcItem)(unsafe.Pointer(pNew)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pNew)).FpSelect)).FselFlags&uint32(SF_NestedFrom) != uint32(0) { - libc.SetBitFieldPtr16Uint32(pNew+60+4, libc.Uint32FromInt32(1), 13, 0x2000) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pOld + 60 + 4))&0x4>>2)) != 0 { - *(*uintptr)(unsafe.Pointer(pNew + 88)) = *(*uintptr)(unsafe.Pointer(pOld + 88)) - *(*uintptr)(unsafe.Pointer(pOld + 88)) = uintptr(0) - libc.SetBitFieldPtr16Uint32(pOld+60+4, libc.Uint32FromInt32(0), 2, 0x4) - libc.SetBitFieldPtr16Uint32(pNew+60+4, libc.Uint32FromInt32(1), 2, 0x4) - } - v347 = libc.UintptrFromInt32(0) - (*TSrcItem)(unsafe.Pointer(pOld)).FzDatabase = v347 - (*TSrcItem)(unsafe.Pointer(pOld)).FzName = v347 - (*TSrcItem)(unsafe.Pointer(pOld)).FpSelect = uintptr(0) + if int32(*(*uint32)(unsafe.Pointer(pOld + 24 + 4))&0x4>>2) != 0 { + libc.SetBitFieldPtr32Uint32(pNew+24+4, libc.Uint32FromInt32(1), 2, 0x4) + *(*uintptr)(unsafe.Pointer(pNew + 72)) = *(*uintptr)(unsafe.Pointer(pOld + 72)) + *(*uintptr)(unsafe.Pointer(pOld + 72)) = uintptr(0) + libc.SetBitFieldPtr32Uint32(pOld+24+4, libc.Uint32FromInt32(0), 2, 0x4) + if (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNew + 72)))).FpSelect)).FselFlags&uint32(SF_NestedFrom) != uint32(0) { + libc.SetBitFieldPtr32Uint32(pNew+24+4, libc.Uint32FromInt32(1), 14, 0x4000) + } + } else { + *(*uintptr)(unsafe.Pointer(pNew + 72)) = *(*uintptr)(unsafe.Pointer(pOld + 72)) + *(*uintptr)(unsafe.Pointer(pOld + 72)) = uintptr(0) + } + if int32(*(*uint32)(unsafe.Pointer(pOld + 24 + 4))&0x8>>3) != 0 { + *(*uintptr)(unsafe.Pointer(pNew + 48)) = *(*uintptr)(unsafe.Pointer(pOld + 48)) + *(*uintptr)(unsafe.Pointer(pOld + 48)) = uintptr(0) + libc.SetBitFieldPtr32Uint32(pOld+24+4, libc.Uint32FromInt32(0), 3, 0x8) + libc.SetBitFieldPtr32Uint32(pNew+24+4, libc.Uint32FromInt32(1), 3, 0x8) + } + (*TSrcItem)(unsafe.Pointer(pOld)).FzName = uintptr(0) } _sqlite3SrcListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8))) } else { @@ -156597,7 +158874,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23537) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23642) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -156735,7 +159012,7 @@ _202: ** in the virtual machine. #N is the N-th register. */ *(*TToken)(unsafe.Pointer(bp + 88)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) /*A-overwrites-X*/ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23546, libc.VaList(bp+128, bp+88)) + _parserSyntaxError(tls, pParse, bp+88) *(*uintptr)(unsafe.Pointer(yymsp + 8)) = uintptr(0) } else { *(*uintptr)(unsafe.Pointer(yymsp + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_REGISTER), uintptr(0), uintptr(0)) @@ -156947,11 +159224,11 @@ _237: */ _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v348 = __ccgo_ts + 8011 + v347 = __ccgo_ts + 8073 } else { - v348 = __ccgo_ts + 8016 + v347 = __ccgo_ts + 8078 } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v348) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } @@ -157011,11 +159288,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v349 = pSrc + v348 = pSrc } else { - v349 = uintptr(0) + v348 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -157025,9 +159302,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 - p5 = v350 + v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 + p5 = v349 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -157035,11 +159312,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -157137,11 +159414,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -157191,15 +159468,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23570, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23651, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23665, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23746, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23749, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23830, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -157208,7 +159485,7 @@ _280: goto _346 _281: ; /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */ - *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3TriggerInsertStep(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(4))*24+8, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8))) /*yylhsminor.yy427-overwrites-yymsp[-6].minor.yy144*/ + *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3TriggerInsertStep(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(4))*24+8, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8))), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8))) /*yylhsminor.yy319-overwrites-yymsp[-6].minor.yy502*/ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) = *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 _282: @@ -157218,7 +159495,7 @@ _282: goto _346 _283: ; /* trigger_cmd ::= scanpt select scanpt */ - *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3TriggerSelectStep(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8))) /*yylhsminor.yy427-overwrites-yymsp[-1].minor.yy555*/ + *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = _sqlite3TriggerSelectStep(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8))) /*yylhsminor.yy319-overwrites-yymsp[-1].minor.yy637*/ *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*uintptr)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 _284: @@ -157229,8 +159506,8 @@ _284: } goto _346 _285: - ; /* expr ::= RAISE LP raisetype COMMA nm RP */ - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)) = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_RAISE), yymsp+uintptr(-libc.Int32FromInt32(1))*24+8, int32(1)) + ; /* expr ::= RAISE LP raisetype COMMA expr RP */ + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)) != 0 { (*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)))).FaffExpr = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8))) } @@ -157524,8 +159801,8 @@ _346: // ** The following code executes when a syntax error first occurs. // */ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor TToken) { - bp := tls.Alloc(32) - defer tls.Free(32) + bp := tls.Alloc(16) + defer tls.Free(16) *(*TToken)(unsafe.Pointer(bp)) = _yyminor var pParse uintptr _ = pParse @@ -157533,9 +159810,9 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor /************ Begin %syntax_error code ****************************************/ _ = yymajor /* Silence some compiler warnings */ if *(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23546, libc.VaList(bp+24, bp)) + _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23834, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23915, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -159785,7 +162062,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { ; i++ } - *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_SPACE) /* IMP: R-22934-25134 */ + *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_COMMENT) return i } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('>') { @@ -159833,7 +162110,7 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { if c != 0 { i++ } - *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_SPACE) /* IMP: R-22934-25134 */ + *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_COMMENT) return i case int32(CC_PERCENT): *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_REM) @@ -159944,6 +162221,8 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_DOT) return int32(1) } + /* If the next character is a digit, this is a floating point + ** number that begins with ".". Fall thru into the next case */ fallthrough case int32(CC_DIGIT): *(*int32)(unsafe.Pointer(tokenType)) = int32(TK_INTEGER) @@ -160167,6 +162446,8 @@ func _sqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) (r int32) { } return i } + /* If it is not a BLOB literal, then it must be an ID, since no + ** SQL keywords start with the letter 'x'. Fall through */ fallthrough case int32(CC_KYWD): fallthrough @@ -160262,11 +162543,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) != int32(TK_QNUMBER) { - (*(*TToken)(unsafe.Pointer(bp + 2440))).Fz = zSql - (*(*TToken)(unsafe.Pointer(bp + 2440))).Fn = libc.Uint32FromInt32(n) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23851, libc.VaList(bp+2464, bp+2440)) - break + if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))<<libc.Int32FromInt32(32)) != uint64(0) { + zSql += uintptr(n) + continue + } else { + if *(*int32)(unsafe.Pointer(bp)) != int32(TK_QNUMBER) { + (*(*TToken)(unsafe.Pointer(bp + 2440))).Fz = zSql + (*(*TToken)(unsafe.Pointer(bp + 2440))).Fn = libc.Uint32FromInt32(n) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23932, libc.VaList(bp+2464, bp+2440)) + break + } } } } @@ -160288,9 +162574,11 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { } if (*TParse)(unsafe.Pointer(pParse)).FzErrMsg != 0 || (*TParse)(unsafe.Pointer(pParse)).Frc != SQLITE_OK && (*TParse)(unsafe.Pointer(pParse)).Frc != int32(SQLITE_DONE) { if (*TParse)(unsafe.Pointer(pParse)).FzErrMsg == uintptr(0) { - (*TParse)(unsafe.Pointer(pParse)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+3859, libc.VaList(bp+2464, _sqlite3ErrStr(tls, (*TParse)(unsafe.Pointer(pParse)).Frc))) + (*TParse)(unsafe.Pointer(pParse)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+3860, libc.VaList(bp+2464, _sqlite3ErrStr(tls, (*TParse)(unsafe.Pointer(pParse)).Frc))) + } + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_DONT_LOG) == 0 { + Xsqlite3_log(tls, (*TParse)(unsafe.Pointer(pParse)).Frc, __ccgo_ts+23957, libc.VaList(bp+2464, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg, (*TParse)(unsafe.Pointer(pParse)).FzTail)) } - Xsqlite3_log(tls, (*TParse)(unsafe.Pointer(pParse)).Frc, __ccgo_ts+23876, libc.VaList(bp+2464, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg, (*TParse)(unsafe.Pointer(pParse)).FzTail)) nErr++ } (*TParse)(unsafe.Pointer(pParse)).FzTail = zSql @@ -160482,7 +162770,7 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { case int32('c'): fallthrough case int32('C'): - if nId == int32(6) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23887, int32(6)) == 0 { + if nId == int32(6) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23968, int32(6)) == 0 { token = uint8(tkCREATE) } else { token = uint8(tkOTHER) @@ -160490,13 +162778,13 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { case int32('t'): fallthrough case int32('T'): - if nId == int32(7) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+20511, int32(7)) == 0 { + if nId == int32(7) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+20596, int32(7)) == 0 { token = uint8(tkTRIGGER) } else { - if nId == int32(4) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23894, int32(4)) == 0 { + if nId == int32(4) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23975, int32(4)) == 0 { token = uint8(tkTEMP) } else { - if nId == int32(9) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23899, int32(9)) == 0 { + if nId == int32(9) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23980, int32(9)) == 0 { token = uint8(tkTEMP) } else { token = uint8(tkOTHER) @@ -160506,10 +162794,10 @@ func Xsqlite3_complete(tls *libc.TLS, zSql uintptr) (r int32) { case int32('e'): fallthrough case int32('E'): - if nId == int32(3) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23909, int32(3)) == 0 { + if nId == int32(3) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23990, int32(3)) == 0 { token = uint8(tkEND) } else { - if nId == int32(7) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23913, int32(7)) == 0 { + if nId == int32(7) && Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+23994, int32(7)) == 0 { token = uint8(tkEXPLAIN) } else { token = uint8(tkOTHER) @@ -160715,29 +163003,6 @@ func Xsqlite3_threadsafe(tls *libc.TLS) (r int32) { // C documentation // // /* -// ** Determine whether or not high-precision (long double) floating point -// ** math works correctly on CPU currently running. -// */ -func _hasHighPrecisionDouble(tls *libc.TLS, rc int32) (r int32) { - var a, b, c float64 - _, _, _ = a, b, c - if uint64(8) <= uint64(8) { - /* If the size of "long double" is not more than 8, then - ** high-precision math is not possible. */ - return 0 - } else { - rc++ - a = float64(1) + float64(rc)*float64(0.1) - b = float64(1e+18) + float64(rc)*float64(25) - c = a + b - return libc.BoolInt32(b != c) - } - return r -} - -// C documentation -// -// /* // ** Initialize SQLite. // ** // ** This routine must be called to initialize the memory allocation, @@ -160879,9 +163144,6 @@ func Xsqlite3_initialize(tls *libc.TLS) (r int32) { /* Do extra initialization steps requested by the SQLITE_EXTRA_INIT ** compile-time option. */ - /* Experimentally determine if high-precision floating point is - ** available. */ - // disabled return rc } @@ -160949,7 +163211,7 @@ func Xsqlite3_config(tls *libc.TLS, op int32, va uintptr) (r int32) { */ if libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_sqlite3Config))+340) != 0 { if op < 0 || op > int32(63) || libc.Uint64FromInt32(1)<<op&_mAnytimeConfigOption == uint64(0) { - return _sqlite3MisuseError(tls, int32(180224)) + return _sqlite3MisuseError(tls, int32(181974)) } } ap = va @@ -161365,7 +163627,7 @@ func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r int3 rc = int32(SQLITE_ERROR) /* IMP: R-42790-23372 */ i = uint32(0) for { - if !(i < libc.Uint32FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(144)/libc.Uint64FromInt64(8)))) { + if !(i < libc.Uint32FromInt32(libc.Int32FromUint64(libc.Uint64FromInt64(336)/libc.Uint64FromInt64(16)))) { break } if _aFlagOp[i].Fop == op { @@ -161373,17 +163635,17 @@ func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r int3 pRes = libc.VaUintptr(&ap) oldFlags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if onoff > 0 { - *(*Tu64)(unsafe.Pointer(db + 48)) |= uint64(_aFlagOp[i].Fmask) + *(*Tu64)(unsafe.Pointer(db + 48)) |= _aFlagOp[i].Fmask } else { if onoff == 0 { - *(*Tu64)(unsafe.Pointer(db + 48)) &= ^uint64(_aFlagOp[i].Fmask) + *(*Tu64)(unsafe.Pointer(db + 48)) &= ^_aFlagOp[i].Fmask } } if oldFlags != (*Tsqlite3)(unsafe.Pointer(db)).Fflags { _sqlite3ExpirePreparedStatements(tls, db, 0) } if pRes != 0 { - *(*int32)(unsafe.Pointer(pRes)) = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(_aFlagOp[i].Fmask) != uint64(0)) + *(*int32)(unsafe.Pointer(pRes)) = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&_aFlagOp[i].Fmask != uint64(0)) } rc = SQLITE_OK break @@ -161400,81 +163662,93 @@ func Xsqlite3_db_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r int3 return rc } -var _aFlagOp = [18]struct { +var _aFlagOp = [21]struct { Fop int32 - Fmask Tu32 + Fmask Tu64 }{ 0: { Fop: int32(SQLITE_DBCONFIG_ENABLE_FKEY), - Fmask: uint32(SQLITE_ForeignKeys), + Fmask: uint64(SQLITE_ForeignKeys), }, 1: { Fop: int32(SQLITE_DBCONFIG_ENABLE_TRIGGER), - Fmask: uint32(SQLITE_EnableTrigger), + Fmask: uint64(SQLITE_EnableTrigger), }, 2: { Fop: int32(SQLITE_DBCONFIG_ENABLE_VIEW), - Fmask: uint32(SQLITE_EnableView), + Fmask: uint64(SQLITE_EnableView), }, 3: { Fop: int32(SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER), - Fmask: uint32(SQLITE_Fts3Tokenizer), + Fmask: uint64(SQLITE_Fts3Tokenizer), }, 4: { Fop: int32(SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION), - Fmask: uint32(SQLITE_LoadExtension), + Fmask: uint64(SQLITE_LoadExtension), }, 5: { Fop: int32(SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE), - Fmask: uint32(SQLITE_NoCkptOnClose), + Fmask: uint64(SQLITE_NoCkptOnClose), }, 6: { Fop: int32(SQLITE_DBCONFIG_ENABLE_QPSG), - Fmask: uint32(SQLITE_EnableQPSG), + Fmask: uint64(SQLITE_EnableQPSG), }, 7: { Fop: int32(SQLITE_DBCONFIG_TRIGGER_EQP), - Fmask: uint32(SQLITE_TriggerEQP), + Fmask: uint64(SQLITE_TriggerEQP), }, 8: { Fop: int32(SQLITE_DBCONFIG_RESET_DATABASE), - Fmask: uint32(SQLITE_ResetDatabase), + Fmask: uint64(SQLITE_ResetDatabase), }, 9: { Fop: int32(SQLITE_DBCONFIG_DEFENSIVE), - Fmask: uint32(SQLITE_Defensive), + Fmask: uint64(SQLITE_Defensive), }, 10: { Fop: int32(SQLITE_DBCONFIG_WRITABLE_SCHEMA), - Fmask: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), + Fmask: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), }, 11: { Fop: int32(SQLITE_DBCONFIG_LEGACY_ALTER_TABLE), - Fmask: uint32(SQLITE_LegacyAlter), + Fmask: uint64(SQLITE_LegacyAlter), }, 12: { Fop: int32(SQLITE_DBCONFIG_DQS_DDL), - Fmask: uint32(SQLITE_DqsDDL), + Fmask: uint64(SQLITE_DqsDDL), }, 13: { Fop: int32(SQLITE_DBCONFIG_DQS_DML), - Fmask: uint32(SQLITE_DqsDML), + Fmask: uint64(SQLITE_DqsDML), }, 14: { Fop: int32(SQLITE_DBCONFIG_LEGACY_FILE_FORMAT), - Fmask: uint32(SQLITE_LegacyFileFmt), + Fmask: uint64(SQLITE_LegacyFileFmt), }, 15: { Fop: int32(SQLITE_DBCONFIG_TRUSTED_SCHEMA), - Fmask: uint32(SQLITE_TrustedSchema), + Fmask: uint64(SQLITE_TrustedSchema), }, 16: { Fop: int32(SQLITE_DBCONFIG_STMT_SCANSTATUS), - Fmask: uint32(SQLITE_StmtScanStatus), + Fmask: uint64(SQLITE_StmtScanStatus), }, 17: { Fop: int32(SQLITE_DBCONFIG_REVERSE_SCANORDER), - Fmask: uint32(SQLITE_ReverseOrder), + Fmask: uint64(SQLITE_ReverseOrder), + }, + 18: { + Fop: int32(SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE), + Fmask: libc.Uint64FromInt32(libc.Int32FromInt32(0x00010)) << libc.Int32FromInt32(32), + }, + 19: { + Fop: int32(SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE), + Fmask: libc.Uint64FromInt32(libc.Int32FromInt32(0x00020)) << libc.Int32FromInt32(32), + }, + 20: { + Fop: int32(SQLITE_DBCONFIG_ENABLE_COMMENTS), + Fmask: libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32), }, } @@ -161747,7 +164021,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(181024)) + return _sqlite3MisuseError(tls, int32(182777)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -161767,7 +164041,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+23921, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24002, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -162068,14 +164342,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24464 + zErr = __ccgo_ts + 24545 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<<libc.Int32FromInt32(8): - zErr = __ccgo_ts + 24478 + zErr = __ccgo_ts + 24559 case int32(SQLITE_ROW): - zErr = __ccgo_ts + 24500 + zErr = __ccgo_ts + 24581 case int32(SQLITE_DONE): - zErr = __ccgo_ts + 24522 + zErr = __ccgo_ts + 24603 default: rc &= int32(0xff) if rc >= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -162087,31 +164361,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 23989, - 1: __ccgo_ts + 24002, - 3: __ccgo_ts + 24018, - 4: __ccgo_ts + 24043, - 5: __ccgo_ts + 24057, - 6: __ccgo_ts + 24076, - 7: __ccgo_ts + 1632, - 8: __ccgo_ts + 24101, - 9: __ccgo_ts + 24138, - 10: __ccgo_ts + 24150, - 11: __ccgo_ts + 24165, - 12: __ccgo_ts + 24198, - 13: __ccgo_ts + 24216, - 14: __ccgo_ts + 24241, - 15: __ccgo_ts + 24270, - 17: __ccgo_ts + 6085, - 18: __ccgo_ts + 5487, - 19: __ccgo_ts + 24287, - 20: __ccgo_ts + 24305, - 21: __ccgo_ts + 24323, - 23: __ccgo_ts + 24357, - 25: __ccgo_ts + 24378, - 26: __ccgo_ts + 24404, - 27: __ccgo_ts + 24427, - 28: __ccgo_ts + 24448, + 0: __ccgo_ts + 24070, + 1: __ccgo_ts + 24083, + 3: __ccgo_ts + 24099, + 4: __ccgo_ts + 24124, + 5: __ccgo_ts + 24138, + 6: __ccgo_ts + 24157, + 7: __ccgo_ts + 1633, + 8: __ccgo_ts + 24182, + 9: __ccgo_ts + 24219, + 10: __ccgo_ts + 24231, + 11: __ccgo_ts + 24246, + 12: __ccgo_ts + 24279, + 13: __ccgo_ts + 24297, + 14: __ccgo_ts + 24322, + 15: __ccgo_ts + 24351, + 17: __ccgo_ts + 6102, + 18: __ccgo_ts + 5504, + 19: __ccgo_ts + 24368, + 20: __ccgo_ts + 24386, + 21: __ccgo_ts + 24404, + 23: __ccgo_ts + 24438, + 25: __ccgo_ts + 24459, + 26: __ccgo_ts + 24485, + 27: __ccgo_ts + 24508, + 28: __ccgo_ts + 24529, } // C documentation @@ -162290,9 +164564,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(181679)) + return _sqlite3MisuseError(tls, int32(183428)) } - extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)) + extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) /* The SQLITE_INNOCUOUS flag is the same bit as SQLITE_FUNC_UNSAFE. But ** the meaning is inverted. So flip the bit. */ @@ -162333,7 +164607,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24545, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24626, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -162367,7 +164641,7 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData - (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int8FromUint16(libc.Uint16FromInt32(nArg)) + (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK } @@ -162459,7 +164733,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24608, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24689, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -162490,7 +164764,7 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -162734,7 +165008,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(182294)) + return _sqlite3MisuseError(tls, int32(184044)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -162744,7 +165018,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24659, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24740, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -162866,7 +165140,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(182430))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -162998,7 +165272,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182509)) + return _sqlite3MisuseError(tls, int32(184259)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -163008,7 +165282,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182518)) + return _sqlite3MisuseError(tls, int32(184268)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -163057,7 +165331,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(182566)) + return _sqlite3MisuseError(tls, int32(184316)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -163066,7 +165340,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24680, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24761, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -163163,8 +165437,8 @@ func Xsqlite3_limit(tls *libc.TLS, db uintptr, limitId int32, newLimit int32) (r if newLimit > _aHardLimit[limitId] { newLimit = _aHardLimit[limitId] /* IMP: R-51463-25634 */ } else { - if newLimit < int32(1) && limitId == SQLITE_LIMIT_LENGTH { - newLimit = int32(1) + if newLimit < int32(SQLITE_MIN_LENGTH) && limitId == SQLITE_LIMIT_LENGTH { + newLimit = int32(SQLITE_MIN_LENGTH) } } *(*int32)(unsafe.Pointer(db + 136 + uintptr(limitId)*4)) = newLimit @@ -163213,7 +165487,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24748, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24829, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -163243,8 +165517,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24754, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24764, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24835, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24845, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -163333,24 +165607,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24792, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24873, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24796, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24877, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24796 + zModeType = __ccgo_ts + 24877 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24817, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24898, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3468 + zModeType = __ccgo_ts + 3469 } if aMode != 0 { mode = 0 @@ -163379,12 +165653,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24832, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24913, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24852, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24933, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -163408,7 +165682,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24876, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24957, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -163428,11 +165702,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24802, + Fz: __ccgo_ts + 24883, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24809, + Fz: __ccgo_ts + 24890, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -163443,19 +165717,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24822, + Fz: __ccgo_ts + 24903, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24825, + Fz: __ccgo_ts + 24906, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24828, + Fz: __ccgo_ts + 24909, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17851, + Fz: __ccgo_ts + 17916, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -163570,7 +165844,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 (*Tsqlite3)(unsafe.Pointer(db)).FszMmap = _sqlite3Config.FszMmap (*Tsqlite3)(unsafe.Pointer(db)).FnextPagesize = 0 (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit = uintptr(unsafe.Pointer(&_sqlite3StdType)) /* Any array of string ptrs will do */ - *(*Tu64)(unsafe.Pointer(db + 48)) |= uint64(libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_ShortColNames)|libc.Int32FromInt32(SQLITE_EnableTrigger)) | libc.Uint32FromUint32(SQLITE_EnableView) | libc.Uint32FromInt32(SQLITE_CacheSpill) | libc.Uint32FromInt32(SQLITE_TrustedSchema) | libc.Uint32FromInt32(SQLITE_DqsDML) | libc.Uint32FromInt32(SQLITE_DqsDDL) | libc.Uint32FromInt32(SQLITE_AutoIndex)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= uint64(libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_ShortColNames)|libc.Int32FromInt32(SQLITE_EnableTrigger))|libc.Uint32FromUint32(SQLITE_EnableView)|libc.Uint32FromInt32(SQLITE_CacheSpill)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00010))<<libc.Int32FromInt32(32) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00020))<<libc.Int32FromInt32(32) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))<<libc.Int32FromInt32(32) | libc.Uint64FromInt32(SQLITE_TrustedSchema) | libc.Uint64FromInt32(SQLITE_DqsDML) | libc.Uint64FromInt32(SQLITE_DqsDDL) | libc.Uint64FromInt32(SQLITE_AutoIndex) _sqlite3HashInit(tls, db+648) _sqlite3HashInit(tls, db+576) /* Add the default collation sequence BINARY. BINARY works for both UTF-8 @@ -163583,8 +165857,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22496, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24892, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22577, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+24973, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -163605,8 +165879,11 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(183238)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ } else { + if zFilename == uintptr(0) { + zFilename = __ccgo_ts + 4255 + } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } if rc != SQLITE_OK { @@ -163614,7 +165891,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3859 + v2 = __ccgo_ts + 3860 } else { v2 = uintptr(0) } @@ -163641,9 +165918,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6649 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6711 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 23894 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 23975 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -163737,7 +166014,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24898 + zFilename = __ccgo_ts + 24979 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -163954,20 +166231,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24901, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+24982, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+24926) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25007) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+24946) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25027) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+24953) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25034) } // C documentation @@ -164067,7 +166344,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, primarykey = libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) autoinc = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0)) } else { - zDataType = __ccgo_ts + 1136 + zDataType = __ccgo_ts + 1137 primarykey = int32(1) } if !(zCollSeq != 0) { @@ -164098,11 +166375,11 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+24970, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25051, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3859 + v3 = __ccgo_ts + 3860 } else { v3 = uintptr(0) } @@ -164222,14 +166499,14 @@ 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) (r int32) { - var aProg, db, db1, db2, db3, db4, db5, db6, pCtx, pI1, pI2, pU64, pn, ptr, xBenignBegin, xBenignEnd uintptr + var aProg, db, db1, db2, db3, db4, db5, db6, db7, pCtx, pI1, pI2, pN, pU64, pn, ptr, xBenignBegin, xBenignEnd uintptr var ap Tva_list - var b, b1, iDb, opTrace, rc, sz, x, x1, x2, y, v1, v3 int32 + var b, iDb, opTrace, rc, sz, x, x1, x2, y, v1, v3 int32 var newVal uint32 var rIn float64 var rLogEst TLogEst var v2 bool - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aProg, ap, b, b1, db, db1, db2, db3, db4, db5, db6, iDb, newVal, opTrace, pCtx, pI1, pI2, pU64, pn, ptr, rIn, rLogEst, rc, sz, x, x1, x2, xBenignBegin, xBenignEnd, y, v1, v2, v3 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aProg, ap, b, db, db1, db2, db3, db4, db5, db6, db7, iDb, newVal, opTrace, pCtx, pI1, pI2, pN, pU64, pn, ptr, rIn, rLogEst, rc, sz, x, x1, x2, xBenignBegin, xBenignEnd, y, v1, v2, v3 rc = 0 ap = va switch op { @@ -164447,6 +166724,17 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { db2 = libc.VaUintptr(&ap) (*Tsqlite3)(unsafe.Pointer(db2)).FdbOptFlags = libc.VaUint32(&ap) break + /* sqlite3_test_control(SQLITE_TESTCTRL_GETOPT, sqlite3 *db, int *N) + ** + ** Write the current optimization settings into *N. A zero bit means that + ** the optimization is on, and a 1 bit means that the optimization is off. + */ + fallthrough + case int32(SQLITE_TESTCTRL_GETOPT): + db3 = libc.VaUintptr(&ap) + pN = libc.VaUintptr(&ap) + *(*int32)(unsafe.Pointer(pN)) = libc.Int32FromUint32((*Tsqlite3)(unsafe.Pointer(db3)).FdbOptFlags) + break /* sqlite3_test_control(SQLITE_TESTCTRL_LOCALTIME_FAULT, onoff, xAlt); ** ** If parameter onoff is 1, subsequent calls to localtime() fail. @@ -164476,8 +166764,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { */ fallthrough case int32(SQLITE_TESTCTRL_INTERNAL_FUNCTIONS): - db3 = libc.VaUintptr(&ap) - *(*Tu32)(unsafe.Pointer(db3 + 44)) ^= uint32(DBFLAG_InternalFunc) + db4 = libc.VaUintptr(&ap) + *(*Tu32)(unsafe.Pointer(db4 + 44)) ^= uint32(DBFLAG_InternalFunc) break /* sqlite3_test_control(SQLITE_TESTCTRL_NEVER_CORRUPT, int); ** @@ -164527,8 +166815,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_SORTER_MMAP, db, nMax); */ fallthrough case int32(SQLITE_TESTCTRL_SORTER_MMAP): - db4 = libc.VaUintptr(&ap) - (*Tsqlite3)(unsafe.Pointer(db4)).FnMaxSorterMmap = libc.VaInt32(&ap) + db5 = libc.VaUintptr(&ap) + (*Tsqlite3)(unsafe.Pointer(db5)).FnMaxSorterMmap = libc.VaInt32(&ap) break /* sqlite3_test_control(SQLITE_TESTCTRL_ISINIT); ** @@ -164559,18 +166847,18 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { */ fallthrough case int32(SQLITE_TESTCTRL_IMPOSTER): - db5 = libc.VaUintptr(&ap) - Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db5)).Fmutex) - iDb = _sqlite3FindDbName(tls, db5, libc.VaUintptr(&ap)) + db6 = libc.VaUintptr(&ap) + Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db6)).Fmutex) + iDb = _sqlite3FindDbName(tls, db6, libc.VaUintptr(&ap)) if iDb >= 0 { - (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FiDb = libc.Uint8FromInt32(iDb) - (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.Fbusy = uint8(libc.AssignBitFieldPtr8Uint32(db5+192+8, libc.Uint32FromInt32(libc.VaInt32(&ap)), 1, 1, 0x2)) - (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FnewTnum = libc.Uint32FromInt32(libc.VaInt32(&ap)) - if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db5)).Finit1.Fbusy) == 0 && (*Tsqlite3)(unsafe.Pointer(db5)).Finit1.FnewTnum > uint32(0) { - _sqlite3ResetAllSchemasOfConnection(tls, db5) + (*Tsqlite3)(unsafe.Pointer(db6)).Finit1.FiDb = libc.Uint8FromInt32(iDb) + (*Tsqlite3)(unsafe.Pointer(db6)).Finit1.Fbusy = uint8(libc.AssignBitFieldPtr8Uint32(db6+192+8, libc.Uint32FromInt32(libc.VaInt32(&ap)), 1, 1, 0x2)) + (*Tsqlite3)(unsafe.Pointer(db6)).Finit1.FnewTnum = libc.Uint32FromInt32(libc.VaInt32(&ap)) + if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db6)).Finit1.Fbusy) == 0 && (*Tsqlite3)(unsafe.Pointer(db6)).Finit1.FnewTnum > uint32(0) { + _sqlite3ResetAllSchemasOfConnection(tls, db6) } } - Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db5)).Fmutex) + Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db6)).Fmutex) break /* sqlite3_test_control(SQLITE_TESTCTRL_RESULT_INTREAL, sqlite3_context*); ** @@ -164598,10 +166886,10 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { */ fallthrough case int32(SQLITE_TESTCTRL_SEEK_COUNT): - db6 = libc.VaUintptr(&ap) + db7 = libc.VaUintptr(&ap) pn = libc.VaUintptr(&ap) *(*Tu64)(unsafe.Pointer(pn)) = uint64(0) - _ = db6 /* Silence harmless unused variable warning */ + _ = db7 /* Silence harmless unused variable warning */ break /* sqlite3_test_control(SQLITE_TESTCTRL_TRACEFLAGS, op, ptr) ** @@ -164648,24 +166936,6 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { *(*Tu64)(unsafe.Pointer(pU64)) = _sqlite3LogEstToInt(tls, rLogEst) *(*int32)(unsafe.Pointer(pI2)) = int32(_sqlite3LogEst(tls, *(*Tu64)(unsafe.Pointer(pU64)))) break - /* sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, int X); - ** - ** X<0 Make no changes to the bUseLongDouble. Just report value. - ** X==0 Disable bUseLongDouble - ** X==1 Enable bUseLongDouble - ** X>=2 Set bUseLongDouble to its default value for this platform - */ - fallthrough - case int32(SQLITE_TESTCTRL_USELONGDOUBLE): - b1 = libc.VaInt32(&ap) - if b1 >= int32(2) { - b1 = _hasHighPrecisionDouble(tls, b1) - } - if b1 >= 0 { - _sqlite3Config.FbUseLongDouble = libc.BoolUint8(b1 > 0) - } - rc = libc.BoolInt32(libc.Int32FromUint8(_sqlite3Config.FbUseLongDouble) != 0) - break /* sqlite3_test_control(SQLITE_TESTCTRL_JSON_SELFCHECK, &onOff); ** ** Activate or deactivate validation of JSONB that is generated from @@ -165006,9 +167276,12 @@ func Xsqlite3_db_readonly(tls *libc.TLS, db uintptr, zDbName uintptr) (r int32) // ** being read by handle db. // */ func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) var iDb, rc int32 - var pBt uintptr - _, _, _ = iDb, pBt, rc + var pBt, pPager uintptr + var _ /* dummy at bp+0 */ Ti64 + _, _, _, _ = iDb, pBt, pPager, rc rc = int32(SQLITE_ERROR) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit) == 0 { @@ -165016,7 +167289,11 @@ func Xsqlite3_snapshot_get(tls *libc.TLS, db uintptr, zDb uintptr, ppSnapshot ui if iDb == 0 || iDb > int32(1) { pBt = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpBt if int32(SQLITE_TXN_WRITE) != _sqlite3BtreeTxnState(tls, pBt) { + pPager = _sqlite3BtreePager(tls, pBt) + *(*Ti64)(unsafe.Pointer(bp)) = 0 + _sqlite3PagerSnapshotOpen(tls, pPager, bp) rc = _sqlite3BtreeBeginTrans(tls, pBt, 0, uintptr(0)) + _sqlite3PagerSnapshotOpen(tls, pPager, uintptr(0)) if rc == SQLITE_OK { rc = _sqlite3PagerSnapshotGet(tls, _sqlite3BtreePager(tls, pBt), ppSnapshot) } @@ -165126,7 +167403,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+24998, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25079, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -165344,7 +167621,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25006 + v2 = __ccgo_ts + 25087 } else { v2 = uintptr(0) } @@ -166224,23 +168501,23 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // ** string must correspond to the JSONB_* integer above. // */ var _jsonbType = [17]uintptr{ - 0: __ccgo_ts + 1648, - 1: __ccgo_ts + 8011, - 2: __ccgo_ts + 8016, - 3: __ccgo_ts + 6370, - 4: __ccgo_ts + 6370, - 5: __ccgo_ts + 6365, - 6: __ccgo_ts + 6365, - 7: __ccgo_ts + 8322, - 8: __ccgo_ts + 8322, - 9: __ccgo_ts + 8322, - 10: __ccgo_ts + 8322, - 11: __ccgo_ts + 25029, - 12: __ccgo_ts + 25035, - 13: __ccgo_ts + 1662, - 14: __ccgo_ts + 1662, - 15: __ccgo_ts + 1662, - 16: __ccgo_ts + 1662, + 0: __ccgo_ts + 1649, + 1: __ccgo_ts + 8073, + 2: __ccgo_ts + 8078, + 3: __ccgo_ts + 6387, + 4: __ccgo_ts + 6387, + 5: __ccgo_ts + 6382, + 6: __ccgo_ts + 6382, + 7: __ccgo_ts + 8384, + 8: __ccgo_ts + 8384, + 9: __ccgo_ts + 8384, + 10: __ccgo_ts + 8384, + 11: __ccgo_ts + 25110, + 12: __ccgo_ts + 25116, + 13: __ccgo_ts + 1663, + 14: __ccgo_ts + 1663, + 15: __ccgo_ts + 1663, + 16: __ccgo_ts + 1663, } // C documentation @@ -167021,8 +169298,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = uint8('u') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = uint8('0') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = uint8('0') - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25042 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25042 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25123 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25123 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -167156,9 +169433,9 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _, _, _, _ = n, n1, z, z1 switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_NULL): - _jsonAppendRawNZ(tls, p, __ccgo_ts+1648, uint32(4)) + _jsonAppendRawNZ(tls, p, __ccgo_ts+1649, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15416, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15478, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -167179,7 +169456,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25140, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -167233,7 +169510,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25169, -int32(1)) } } } @@ -167516,8 +169793,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25103, - FzRepl: __ccgo_ts + 25107, + FzMatch: __ccgo_ts + 25184, + FzRepl: __ccgo_ts + 25188, }, 1: { Fc1: uint8('i'), @@ -167525,32 +169802,32 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25115, - FzRepl: __ccgo_ts + 25107, + FzMatch: __ccgo_ts + 25196, + FzRepl: __ccgo_ts + 25188, }, 2: { Fc1: uint8('n'), Fc2: uint8('N'), Fn: uint8(3), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 1653, - FzRepl: __ccgo_ts + 1648, + FzMatch: __ccgo_ts + 1654, + FzRepl: __ccgo_ts + 1649, }, 3: { Fc1: uint8('q'), Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25124, - FzRepl: __ccgo_ts + 1648, + FzMatch: __ccgo_ts + 25205, + FzRepl: __ccgo_ts + 1649, }, 4: { Fc1: uint8('s'), Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25129, - FzRepl: __ccgo_ts + 1648, + FzMatch: __ccgo_ts + 25210, + FzRepl: __ccgo_ts + 1649, }, } @@ -167565,7 +169842,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25134, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25215, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -168023,7 +170300,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25177, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25258, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -168492,7 +170769,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8011, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8073, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -168500,7 +170777,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8016, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8078, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -168577,14 +170854,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25103, int32(3)) == 0 { + if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25184, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25186) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25267) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25193) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25199, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25280, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -168745,10 +171022,11 @@ _29: return -int32(1) _37: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1648, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1649, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) return libc.Int32FromUint32(i + uint32(4)) } + /* fall-through into the default case that checks for NaN */ _38: ; c = *(*uint8)(unsafe.Pointer(z + uintptr(i))) @@ -168768,7 +171046,7 @@ _38: goto _51 } if libc.Int32FromUint8(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25193) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -168813,7 +171091,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*uint8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -168826,7 +171104,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -168989,15 +171267,15 @@ func _jsonTranslateBlobToText(tls *libc.TLS, pParse uintptr, i Tu32, pOut uintpt goto _16 _2: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1648, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1649, uint32(4)) return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8011, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8073, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8016, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8078, uint32(5)) return i + uint32(1) _6: ; @@ -169046,9 +171324,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25107 + v19 = __ccgo_ts + 25188 } else { - v19 = __ccgo_ts + 11878 + v19 = __ccgo_ts + 11940 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -169113,7 +171391,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25205, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25286, uint32(2)) zIn2++ sz2-- continue @@ -169136,7 +171414,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25208, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25289, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -169144,12 +171422,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25215, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25296, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25220, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25301, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -169329,7 +171607,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25227, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25308, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -169352,12 +171630,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25230, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25311, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25227, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25308, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -169854,6 +172132,9 @@ func _jsonLookupStep(tls *libc.TLS, pParse uintptr, iRoot Tu32, zPath uintptr, i if !(*(*uint8)(unsafe.Pointer(zPath + uintptr(i))) != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(i)))) != int32('"')) { break } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(i)))) == int32('\\') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(i+uint32(1))))) != 0 { + i++ + } goto _1 _1: ; @@ -170089,7 +172370,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -170325,7 +172606,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) return } @@ -170366,7 +172647,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25059, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25140, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -170379,7 +172660,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -170398,10 +172679,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25193) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('-') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25186) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25267) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -170440,7 +172721,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25233, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25314, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -170537,7 +172818,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -170719,7 +173000,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -170854,7 +173135,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25251 + v1 = __ccgo_ts + 25332 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -170864,7 +173145,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) } } eErr = uint8(1) @@ -170966,23 +173247,31 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { ** NUMBER ==> $[NUMBER] // PG compatible ** LABEL ==> $.LABEL // PG compatible ** [NUMBER] ==> $[NUMBER] // Not PG. Purely for convenience + ** + ** Updated 2024-05-27: If the NUMBER is negative, then PG counts from + ** the right of the array. Hence for negative NUMBER: + ** + ** NUMBER ==> $[#NUMBER] // PG compatible */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25253, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25334, uint32(1)) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25336, uint32(1)) + } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5225, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5226, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1675, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1676, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25255, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25338, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25258, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25341, uint32(1)) } } } @@ -171018,11 +173307,11 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { goto json_extract_error /* Return NULL if not found */ } else { _jsonAppendSeparator(tls, bp) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1648, uint32(4)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1649, uint32(4)) } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -171290,7 +173579,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -171314,7 +173603,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25260, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25343, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -171325,7 +173614,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25311, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25394, -int32(1)) _jsonStringReset(tls, bp) return } @@ -171397,7 +173686,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) } } goto json_remove_done @@ -171434,7 +173723,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15889) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15951) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -171465,9 +173754,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25345 + v1 = __ccgo_ts + 25428 } else { - v1 = __ccgo_ts + 25349 + v1 = __ccgo_ts + 25432 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -171515,7 +173804,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25088, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) } } goto json_type_done @@ -171562,7 +173851,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25356 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25439 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -171646,7 +173935,7 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25361, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25444, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -171671,6 +173960,8 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } break } + /* Fall through into interpreting the input as text. See note + ** above at tag-20240123-a. */ fallthrough default: if libc.Int32FromUint8(flags)&int32(0x3) == 0 { @@ -171835,7 +174126,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25418, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25501, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -171984,7 +174275,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25421, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25504, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -172087,7 +174378,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25424) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25507) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -172221,7 +174512,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25507, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25590, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -172247,9 +174538,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25514, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25597, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25522, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25605, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -172635,7 +174926,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+25528, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25611, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -172659,7 +174950,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25088, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25169, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -172718,188 +175009,188 @@ func _sqlite3RegisterJsonFunctions(tls *libc.TLS) { var _aJsonFunc = [34]TFuncDef{ 0: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25530, + FzName: __ccgo_ts + 25613, }, 1: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25535, + FzName: __ccgo_ts + 25618, }, 2: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25541, + FzName: __ccgo_ts + 25624, }, 3: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25552, + FzName: __ccgo_ts + 25635, }, 4: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25564, + FzName: __ccgo_ts + 25647, }, 5: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25564, + FzName: __ccgo_ts + 25647, }, 6: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25582, + FzName: __ccgo_ts + 25665, }, 7: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25602, + FzName: __ccgo_ts + 25685, }, 8: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25615, + FzName: __ccgo_ts + 25698, }, 9: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25629, + FzName: __ccgo_ts + 25712, }, 10: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25632, + FzName: __ccgo_ts + 25715, }, 11: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25636, + FzName: __ccgo_ts + 25719, }, 12: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25648, + FzName: __ccgo_ts + 25731, }, 13: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25661, + FzName: __ccgo_ts + 25744, }, 14: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25673, + FzName: __ccgo_ts + 25756, }, 15: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25686, + FzName: __ccgo_ts + 25769, }, 16: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25697, + FzName: __ccgo_ts + 25780, }, 17: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25709, + FzName: __ccgo_ts + 25792, }, 18: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25709, + FzName: __ccgo_ts + 25792, }, 19: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25721, + FzName: __ccgo_ts + 25804, }, 20: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25732, + FzName: __ccgo_ts + 25815, }, 21: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25744, + FzName: __ccgo_ts + 25827, }, 22: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25757, + FzName: __ccgo_ts + 25840, }, 23: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25770, + FzName: __ccgo_ts + 25853, }, 24: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25784, + FzName: __ccgo_ts + 25867, }, 25: { - FnArg: int8(-int32(1)), + FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25793, + FzName: __ccgo_ts + 25876, }, 26: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25803, + FzName: __ccgo_ts + 25886, }, 27: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25803, + FzName: __ccgo_ts + 25886, }, 28: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25813, + FzName: __ccgo_ts + 25896, }, 29: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25813, + FzName: __ccgo_ts + 25896, }, 30: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25824, + FzName: __ccgo_ts + 25907, }, 31: { - FnArg: int8(1), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25841, + FzName: __ccgo_ts + 25924, }, 32: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25859, + FzName: __ccgo_ts + 25942, }, 33: { - FnArg: int8(2), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25877, + FzName: __ccgo_ts + 25960, }, } @@ -172982,11 +175273,11 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25896, + FzName: __ccgo_ts + 25979, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25906, + FzName: __ccgo_ts + 25989, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } @@ -173632,7 +175923,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+25916, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+25999, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -173937,7 +176228,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+25921, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26004, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -174854,7 +177145,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26003) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26086) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -176389,7 +178680,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26017, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26100, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -176399,11 +178690,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26037, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26120, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26069, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26152, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -176617,7 +178908,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26106, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26189, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -176671,9 +178962,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26251 + zFmt = __ccgo_ts + 26334 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11707, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11769, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -176731,9 +179022,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26307, - 1: __ccgo_ts + 5548, - 2: __ccgo_ts + 16781, + 0: __ccgo_ts + 26390, + 1: __ccgo_ts + 5565, + 2: __ccgo_ts + 16846, } var _rtreeModule = Tsqlite3_module{ @@ -176777,21 +179068,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26721, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26804, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26783, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26866, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26788, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26852, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26922, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26871, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26935, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27005, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -176821,7 +179112,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 26971 + zFormat = __ccgo_ts + 27054 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -176836,31 +179127,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27079, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27162, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27124, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27207, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13215, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13277, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27151, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27234, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27173, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27256, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27181, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27264, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -176874,14 +179165,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26312, - 1: __ccgo_ts + 26365, - 2: __ccgo_ts + 26410, - 3: __ccgo_ts + 26462, - 4: __ccgo_ts + 26516, - 5: __ccgo_ts + 26561, - 6: __ccgo_ts + 26619, - 7: __ccgo_ts + 26674, + 0: __ccgo_ts + 26395, + 1: __ccgo_ts + 26448, + 2: __ccgo_ts + 26493, + 3: __ccgo_ts + 26545, + 4: __ccgo_ts + 26599, + 5: __ccgo_ts + 26644, + 6: __ccgo_ts + 26702, + 7: __ccgo_ts + 26757, } // C documentation @@ -176939,7 +179230,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27197, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27280, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -176947,17 +179238,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27217, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27300, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+27274, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+27357, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) } } } @@ -177005,14 +179296,14 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt eCoordType = v1 ii = int32(4) aErrMsg = [5]uintptr{ - 1: __ccgo_ts + 27309, - 2: __ccgo_ts + 27352, - 3: __ccgo_ts + 27387, - 4: __ccgo_ts + 27423, + 1: __ccgo_ts + 27392, + 2: __ccgo_ts + 27435, + 3: __ccgo_ts + 27470, + 4: __ccgo_ts + 27506, } /* Aux columns counted by a u8 */ if argc < int32(6) || argc > libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -177034,13 +179325,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27460, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27543, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** 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, __ccgo_ts+27466, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27549, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -177049,7 +179340,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27490, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27573, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -177063,19 +179354,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27517, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27600, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -177098,7 +179389,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -177109,7 +179400,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -177125,8 +179416,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27496, - 1: __ccgo_ts + 27507, + 0: __ccgo_ts + 27579, + 1: __ccgo_ts + 27590, } // C documentation @@ -177184,29 +179475,29 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11327, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11389, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27520, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27603, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27526, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27609, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27530, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27613, int32(1)) goto _1 _1: ; ii++ } errCode = Xsqlite3_str_errcode(tls, pOut) - Xsqlite3_result_text(tls, ctx, Xsqlite3_str_finish(tls, pOut), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_result_error_code(tls, ctx, errCode) + Xsqlite3_result_text(tls, ctx, Xsqlite3_str_finish(tls, pOut), -int32(1), __ccgo_fp(Xsqlite3_free)) } // C documentation @@ -177225,7 +179516,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27532, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27615, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -177343,11 +179634,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4267 + v1 = __ccgo_ts + 4268 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27565, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27648, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -177381,7 +179672,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27572, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27655, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -177398,7 +179689,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27617, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27700, libc.VaList(bp+8, iNode)) } } return pRet @@ -177427,8 +179718,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27649, - 1: __ccgo_ts + 27703, + 0: __ccgo_ts + 27732, + 1: __ccgo_ts + 27786, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -177441,21 +179732,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27751 + v1 = __ccgo_ts + 27834 } else { - v1 = __ccgo_ts + 27759 + v1 = __ccgo_ts + 27842 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27768, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27851, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27751 + v2 = __ccgo_ts + 27834 } else { - v2 = __ccgo_ts + 27759 + v2 = __ccgo_ts + 27842 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27813, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27896, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -177500,7 +179791,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27871, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27954, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -177518,7 +179809,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27919, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28002, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -177551,19 +179842,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27986, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28069, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28020, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28103, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28050, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28133, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -177608,12 +179899,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28105, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28188, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28136, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28219, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -177642,7 +179933,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28203, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28286, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -177652,11 +179943,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26017, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26100, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28231, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28314, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -177672,8 +179963,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28262, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28269, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28345, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28352, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -177700,7 +179991,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28277, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28360, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -177751,13 +180042,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28296, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28379, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6649 + zDb = __ccgo_ts + 6711 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -177766,7 +180057,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18548 + v1 = __ccgo_ts + 18613 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -178233,19 +180524,19 @@ func _geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if p != 0 { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) - Xsqlite3_str_append(tls, x, __ccgo_ts+25253, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+25334, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28347, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28430, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28358, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28441, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -178274,20 +180565,20 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) cSep = uint8('\'') - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28369, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28452, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28387, libc.VaList(bp+8, libc.Int32FromUint8(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28470, libc.VaList(bp+8, libc.Int32FromUint8(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) cSep = uint8(' ') goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28395, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28478, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) i = int32(1) for { if !(i < argc) { @@ -178295,14 +180586,14 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if z != 0 && *(*uint8)(unsafe.Pointer(z)) != 0 { - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28403, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28486, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28407, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28490, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -179431,13 +181722,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27460, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27543, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** 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, __ccgo_ts+28420, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28503, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -179446,13 +181737,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28442, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28525, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27517, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27600, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -179460,7 +181751,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -179475,7 +181766,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -179687,7 +181978,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16781 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16846 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -179697,7 +181988,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28446 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28529 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -179705,7 +181996,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28452 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28535 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -179825,7 +182116,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28461, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28544, 0) } goto geopoly_update_end } @@ -179928,12 +182219,12 @@ geopoly_update_end: func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28501) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28584) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28517) == 0 { + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28600) == 0 { *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) @@ -180004,7 +182295,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28694, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28777, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -180018,61 +182309,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28532, + FzName: __ccgo_ts + 28615, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28545, + FzName: __ccgo_ts + 28628, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28558, + FzName: __ccgo_ts + 28641, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28571, + FzName: __ccgo_ts + 28654, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28517, + FzName: __ccgo_ts + 28600, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28583, + FzName: __ccgo_ts + 28666, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28501, + FzName: __ccgo_ts + 28584, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28606, + FzName: __ccgo_ts + 28689, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28620, + FzName: __ccgo_ts + 28703, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28633, + FzName: __ccgo_ts + 28716, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28647, + FzName: __ccgo_ts + 28730, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28663, + FzName: __ccgo_ts + 28746, }, } @@ -180098,7 +182389,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28675, + FzName: __ccgo_ts + 28758, }, } @@ -180123,20 +182414,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28702, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28785, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28712, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28795, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28723, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28806, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28446, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28529, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28734, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28817, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -180238,7 +182529,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26003, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26086, __ccgo_fp(_rtreeMatchArgFree)) } } } @@ -180707,7 +182998,7 @@ type Tsqlite3rbu = struct { Frc int32 FzErrmsg uintptr FnStep int32 - FnProgress int32 + FnProgress Tsqlite3_int64 Fobjiter TRbuObjIter FzVfsName uintptr FpTargetFd uintptr @@ -181070,7 +183361,7 @@ type Tsqlite3rbu1 = struct { Frc int32 FzErrmsg uintptr FnStep int32 - FnProgress int32 + FnProgress Tsqlite3_int64 Fobjiter TRbuObjIter FzVfsName uintptr FpTargetFd uintptr @@ -181168,8 +183459,8 @@ type rbu_file1 = Trbu_file1 func _rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) (r uint32) { var c, v1 int32 var v uint32 - var z, zStart, v2, p3 uintptr - _, _, _, _, _, _, _ = c, v, z, zStart, v1, v2, p3 + var z, zStart, v2 uintptr + _, _, _, _, _, _ = c, v, z, zStart, v1, v2 v = uint32(0) z = *(*uintptr)(unsafe.Pointer(pz)) zStart = z @@ -181184,8 +183475,7 @@ func _rbuDeltaGetInt(tls *libc.TLS, pz uintptr, pLen uintptr) (r uint32) { v = v<<int32(6) + libc.Uint32FromInt32(c) } z-- - p3 = pLen - *(*int32)(unsafe.Pointer(p3)) = int32(int64(*(*int32)(unsafe.Pointer(p3))) - (int64(z) - int64(zStart))) + *(*int32)(unsafe.Pointer(pLen)) -= int32(int64(z) - int64(zStart)) *(*uintptr)(unsafe.Pointer(pz)) = z return v } @@ -181448,6 +183738,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt var aDelta, aOrig, aOut uintptr var nDelta, nOrig, nOut, nOut2 int32 _, _, _, _, _, _, _ = aDelta, aOrig, aOut, nDelta, nOrig, nOut, nOut2 + _ = argc nOrig = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) aOrig = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) nDelta = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) @@ -181455,7 +183746,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28744, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28827, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -181465,7 +183756,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28744, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28827, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -181491,7 +183782,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -181514,7 +183805,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -181646,7 +183937,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28765, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28848, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -181735,7 +184026,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+25916, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+25999, zIn, uint64(4)) == 0 { i = int32(4) for { if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -181772,13 +184063,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint64(192)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 28936 + v1 = __ccgo_ts + 29019 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+28977, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29060, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29127) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29210) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -181945,7 +184236,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -182006,7 +184297,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29252, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29335, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -182016,7 +184307,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29371, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29454, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -182024,7 +184315,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29392, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29475, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -182036,7 +184327,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29443, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29526, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -182080,7 +184371,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29464, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29547, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -182093,7 +184384,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -182146,7 +184437,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20036, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20121, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -182157,7 +184448,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29521, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29604, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -182168,7 +184459,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29540, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29623, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -182176,7 +184467,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29545, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29628, zName) { bRbuRowid = int32(1) } } @@ -182190,17 +184481,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29555 + v4 = __ccgo_ts + 29638 } else { - v4 = __ccgo_ts + 29568 + v4 = __ccgo_ts + 29651 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29660, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29606, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29689, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -182222,7 +184513,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29628, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29711, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -182261,15 +184552,15 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) var z, zList, zSep uintptr _, _, _, _ = i, z, zList, zSep zList = uintptr(0) - zSep = __ccgo_ts + 1662 + zSep = __ccgo_ts + 1663 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29655, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15083 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29738, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15145 goto _1 _1: ; @@ -182294,7 +184585,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, _, _, _, _, _ = i, iPk, zCol, zRet, zSep iPk = int32(1) zRet = uintptr(0) - zSep = __ccgo_ts + 1662 + zSep = __ccgo_ts + 1663 for int32(1) != 0 { i = 0 for { @@ -182303,7 +184594,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29664, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29747, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -182351,21 +184642,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29677, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29760, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29709, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29792, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1662, __ccgo_ts+15083, __ccgo_ts+29732) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29738, __ccgo_ts+29745, __ccgo_ts+5170) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1662, __ccgo_ts+15083, __ccgo_ts+1662) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+29815) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29821, __ccgo_ts+29828, __ccgo_ts+5171) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+1663) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29753, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29836, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29795, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29878, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -182414,10 +184705,10 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zVector = uintptr(0) zRet = uintptr(0) bFailed = 0 - zSep = __ccgo_ts + 1662 + zSep = __ccgo_ts + 1663 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -182439,15 +184730,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 29815 + zCol = __ccgo_ts + 29898 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29823, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29844, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15083 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29906, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29927, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29963, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15145 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -182456,9 +184747,9 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29907, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29990, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - zSep = __ccgo_ts + 1662 + zSep = __ccgo_ts + 1663 iCol = 0 for { if !(iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol) { @@ -182473,15 +184764,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+29955, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15083 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30038, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15145 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29962, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30045, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -182535,11 +184826,11 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zImpPK = uintptr(0) /* String to return via *pzImposterPK */ zWhere = uintptr(0) /* String to return via *pzWhere */ nBind = 0 /* Value to return via *pnBind */ - zCom = __ccgo_ts + 1662 /* Set to ", " later on */ - zAnd = __ccgo_ts + 1662 /* Set to " AND " later on */ + zCom = __ccgo_ts + 1663 /* Set to ", " later on */ + zAnd = __ccgo_ts + 1663 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -182548,8 +184839,8 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+29974, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) - zType = __ccgo_ts + 1662 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30057, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zType = __ccgo_ts + 1663 } else { if iCid < 0 { /* An integer primary key. If the table has an explicit IPK, use @@ -182568,34 +184859,34 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29815 + zCol = __ccgo_ts + 29898 } else { - zCol = __ccgo_ts + 29545 + zCol = __ccgo_ts + 29628 } } - zType = __ccgo_ts + 1136 + zType = __ccgo_ts + 1137 } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+29996, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30079, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29732 + v2 = __ccgo_ts + 29815 } else { - v2 = __ccgo_ts + 1662 + v2 = __ccgo_ts + 1663 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30016, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30099, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30037, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30070, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30120, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30153, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15083 - zAnd = __ccgo_ts + 22158 + zCom = __ccgo_ts + 15145 + zAnd = __ccgo_ts + 22230 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -182641,7 +184932,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr _, _, _, _ = i, zCol, zList, zS zList = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zS = __ccgo_ts + 1662 + zS = __ccgo_ts + 1663 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -182649,11 +184940,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30094, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30177, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30106, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30189, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15083 + zS = __ccgo_ts + 15145 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -182665,7 +184956,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 (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30115, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30198, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -182691,27 +184982,27 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30130, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30213, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - zSep = __ccgo_ts + 1662 + zSep = __ccgo_ts + 1663 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30144, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22158 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30227, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22230 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30156, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30239, libc.VaList(bp+8, zList)) } else { - zSep1 = __ccgo_ts + 1662 + zSep1 = __ccgo_ts + 1663 i1 = 0 for { if !(i1 < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -182719,8 +185010,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30206, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22158 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30289, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22230 } goto _2 _2: @@ -182743,7 +185034,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30219, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30302, 0) } // C documentation @@ -182777,7 +185068,7 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt if libc.Int32FromUint64(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { _rbuBadControlError(tls, p) } else { - zSep = __ccgo_ts + 1662 + zSep = __ccgo_ts + 1663 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -182785,16 +185076,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*uint8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if libc.Int32FromUint8(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30206, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15083 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30289, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15145 } else { if libc.Int32FromUint8(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30245, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15083 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30328, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15145 } else { if libc.Int32FromUint8(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30275, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15083 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30358, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15145 } } } @@ -182878,16 +185169,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30312 + zSep = __ccgo_ts + 30395 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = <pk-index> */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29464, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29547, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16669) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16734) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, zIdx))) } break } @@ -182898,16 +185189,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 29732 + v1 = __ccgo_ts + 29815 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30325, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15083 + z = _rbuMPrintf(tls, p, __ccgo_ts+30408, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15145 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30336, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30419, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -182947,13 +185238,13 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT name ... WHERE rootpage = $tnum */ zIdx = uintptr(0) /* Name of PK index */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA main.index_xinfo = $zIdx */ - zComma = __ccgo_ts + 1662 + zComma = __ccgo_ts + 1663 zCols = uintptr(0) /* Used to build up list of table cols */ zPk = uintptr(0) /* Used to build up table PK declaration */ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30340) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30423) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -182961,7 +185252,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29492, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -182970,21 +185261,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30390, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30473, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29732 + v1 = __ccgo_ts + 29815 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30412, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15083 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30495, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15145 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30422, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30505, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30437, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30520, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) } } @@ -183019,30 +185310,30 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _, _, _, _, _, _, _ = iCol, tnum, zCol, zComma, zPk, zPk1, zSql, v2, v3 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum - zComma = __ccgo_ts + 1662 + zComma = __ccgo_ts + 1663 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } - zPk = __ccgo_ts + 1662 + zPk = __ccgo_ts + 1663 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(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 = __ccgo_ts + 30499 + zPk = __ccgo_ts + 30582 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30512 + v2 = __ccgo_ts + 30595 } else { - v2 = __ccgo_ts + 1662 + v2 = __ccgo_ts + 1663 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30522, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15083 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30605, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15145 goto _1 _1: ; @@ -183051,17 +185342,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30549, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30632, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30556 + v3 = __ccgo_ts + 30639 } else { - v3 = __ccgo_ts + 1662 + v3 = __ccgo_ts + 1663 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30571, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30654, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) } } @@ -183087,7 +185378,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30603, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30686, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -183098,7 +185389,7 @@ func _rbuTmpInsertFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { p = Xsqlite3_user_data(tls, pCtx) rc = SQLITE_OK if Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal))) != 0 { - *(*Ti64)(unsafe.Pointer(p + 304)) += int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex) + *(*Ti64)(unsafe.Pointer(p + 312)) += int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex) } i = 0 for { @@ -183133,7 +185424,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30660) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30743) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -183302,7 +185593,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30726, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30809, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -183319,18 +185610,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30746, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30829, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30811, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30894, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30847, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30930, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -183345,26 +185636,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30881 + v2 = __ccgo_ts + 30964 } else { - v2 = __ccgo_ts + 30885 + v2 = __ccgo_ts + 30968 } v1 = v2 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30891, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30974, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30952, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31035, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30881 + v3 = __ccgo_ts + 30964 } else { - v3 = __ccgo_ts + 30885 + v3 = __ccgo_ts + 30968 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31013, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31096, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -183383,62 +185674,62 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6660) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6656) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6722) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6718) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ _rbuCreateImposterTable(tls, p, pIter) _rbuCreateImposterTable2(tls, p, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { - v4 = __ccgo_ts + 1662 + v4 = __ccgo_ts + 1663 } else { - v4 = __ccgo_ts + 31172 + v4 = __ccgo_ts + 31255 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31181 + v5 = __ccgo_ts + 31264 } else { - v5 = __ccgo_ts + 1662 + v5 = __ccgo_ts + 1663 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31191, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31274, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31227, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31310, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zRbuRowid = __ccgo_ts + 1662 + zRbuRowid = __ccgo_ts + 1663 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31255 + zRbuRowid = __ccgo_ts + 31338 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31267 + v6 = __ccgo_ts + 31350 } else { - v6 = __ccgo_ts + 1662 + v6 = __ccgo_ts + 1663 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31284, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31360, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31367, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31443, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31659, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31742, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } /* Create the SELECT statement to read keys from data_xxx */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zRbuRowid1 = __ccgo_ts + 1662 + zRbuRowid1 = __ccgo_ts + 1663 zStart1 = uintptr(0) zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31758 + v7 = __ccgo_ts + 31841 } else { - v7 = __ccgo_ts + 31768 + v7 = __ccgo_ts + 31851 } zRbuRowid1 = v7 } @@ -183451,28 +185742,28 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29815, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29898, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1662, __ccgo_ts+15083, __ccgo_ts+1662) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+1663) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31779 + v8 = __ccgo_ts + 31862 } else { - v8 = __ccgo_ts + 1662 + v8 = __ccgo_ts + 1663 } if zStart1 != 0 { v9 = zStart1 } else { - v9 = __ccgo_ts + 1662 + v9 = __ccgo_ts + 1663 } if zOrder != 0 { - v10 = __ccgo_ts + 23381 + v10 = __ccgo_ts + 23486 } else { - v10 = __ccgo_ts + 1662 + v10 = __ccgo_ts + 1663 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31785, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31868, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -183558,11 +185849,11 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp if zSet != 0 { - zPrefix = __ccgo_ts + 1662 + zPrefix = __ccgo_ts + 1663 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31172 + zPrefix = __ccgo_ts + 31255 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31833, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31916, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -183589,7 +185880,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -183636,7 +185927,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31863, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31946, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -183695,27 +185986,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6649, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6649) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31893, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31976, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31921, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3482, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32004, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3483, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6649, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6711, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31939, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32022, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6649, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -183748,10 +186039,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32005, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32088, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24748, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24829, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -183765,16 +186056,16 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if zExtra == uintptr(0) { - v2 = __ccgo_ts + 1662 + v2 = __ccgo_ts + 1663 } else { - v2 = __ccgo_ts + 32037 + v2 = __ccgo_ts + 32120 } if zExtra == uintptr(0) { - v3 = __ccgo_ts + 1662 + v3 = __ccgo_ts + 1663 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32039, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6649), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32122, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -183785,27 +186076,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32071, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32154, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32086, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32169, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32103, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32186, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32119, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32202, 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 (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32147, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32230, 0) } } @@ -183832,6 +186123,8 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) // ** test.db-mj7f3319fa => test.9fa // */ func _rbuFileSuffix3(tls *libc.TLS, zBase uintptr, z uintptr) { + _ = zBase + _ = z } // C documentation @@ -183889,7 +186182,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { if pState == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32119, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32202, uintptr(0), uintptr(0), uintptr(0)) } } /* Assuming no error has occurred, run a "restart" checkpoint with the @@ -183922,7 +186215,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CAPTURE) - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32165, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32248, uintptr(0), uintptr(0), uintptr(0)) if rc2 != int32(SQLITE_NOTICE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -184055,16 +186348,16 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6649, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6649, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_FILE_POINTER), bp) rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6649, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6649, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) @@ -184086,7 +186379,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32200, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32283, 0) } // C documentation @@ -184103,13 +186396,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6649) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32225, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32232, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32308, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32315, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -184124,7 +186417,7 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { _rbuFileSuffix3(tls, zBase, zWal) _rbuFileSuffix3(tls, zBase, zOal) /* Re-open the databases. */ - _rbuObjIterFinalize(tls, p+80) + _rbuObjIterFinalize(tls, p+88) Xsqlite3_close(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu) Xsqlite3_close(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = uintptr(0) @@ -184218,13 +186511,13 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { var i int32 var pIter, pVal, pWriter uintptr _, _, _, _ = i, pIter, pVal, pWriter - pIter = p + 80 + pIter = p + 88 /* If this is a delete, decrement nPhaseOneStep by nIndex. If the DELETE ** statement below does actually delete a row, nPhaseOneStep will be ** incremented by the same amount when SQL function rbu_tmp_insert() ** is invoked by the trigger. */ if eType == int32(RBU_DELETE) { - *(*Ti64)(unsafe.Pointer(p + 304)) -= int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex) + *(*Ti64)(unsafe.Pointer(p + 312)) -= int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex) } if eType == int32(RBU_IDX_DELETE) || eType == int32(RBU_DELETE) { pWriter = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpDelete @@ -184241,7 +186534,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24305, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24386, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -184298,7 +186591,7 @@ func _rbuStep(tls *libc.TLS, p uintptr) (r int32) { var _ /* pUpdate at bp+8 */ uintptr var _ /* zMask at bp+0 */ uintptr _, _, _, _, _ = c, eType, i, pIter, pVal - pIter = p + 80 + pIter = p + 88 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) eType = _rbuStepType(tls, p, bp) if eType != 0 { @@ -184307,7 +186600,7 @@ func _rbuStep(tls *libc.TLS, p uintptr) (r int32) { } else { if eType == int32(RBU_REPLACE) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - *(*Ti64)(unsafe.Pointer(p + 304)) += int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex) + *(*Ti64)(unsafe.Pointer(p + 312)) += int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex) _rbuStepOneOp(tls, p, int32(RBU_DELETE)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -184318,7 +186611,7 @@ func _rbuStep(tls *libc.TLS, p uintptr) (r int32) { _rbuStepOneOp(tls, p, eType) } else { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - *(*Ti64)(unsafe.Pointer(p + 304)) -= int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex) + *(*Ti64)(unsafe.Pointer(p + 312)) -= int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FnIndex) _rbuGetUpdateStmt(tls, p, pIter, *(*uintptr)(unsafe.Pointer(bp)), bp+8) if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { i = 0 @@ -184377,7 +186670,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32239) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32322) if (*Tsqlite3rbu)(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 @@ -184390,7 +186683,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32261, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32344, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -184417,7 +186710,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32288, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32371, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -184453,9 +186746,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32446, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32531, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32461, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32546, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -184478,9 +186771,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32481, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32566, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32506) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32591) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -184491,10 +186784,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32614) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32699) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32679) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32764) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -184512,7 +186805,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32723, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32808, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -184534,13 +186827,13 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if p != 0 { switch (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage { case int32(RBU_STAGE_OAL): - pIter = p + 80 + pIter = p + 88 /* If this is an RBU vacuum operation and the state table was empty ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17754) - _rbuCopyPragma(tls, p, __ccgo_ts+16865) + _rbuCopyPragma(tls, p, __ccgo_ts+17819) + _rbuCopyPragma(tls, p, __ccgo_ts+16930) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184548,7 +186841,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32748, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32833, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -184570,10 +186863,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+14987, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+14987, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -184653,18 +186946,18 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { var rc int32 _, _ = pIter, rc if (*TRbuState)(unsafe.Pointer(pState)).FzTbl != 0 { - pIter = p + 80 + pIter = p + 88 rc = SQLITE_OK for rc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 && ((*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 || _rbuStrCompare(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, (*TRbuState)(unsafe.Pointer(pState)).FzIdx) != 0 || (*TRbuState)(unsafe.Pointer(pState)).FzDataTbl == uintptr(0) && _rbuStrCompare(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, (*TRbuState)(unsafe.Pointer(pState)).FzTbl) != 0 || (*TRbuState)(unsafe.Pointer(pState)).FzDataTbl != 0 && _rbuStrCompare(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, (*TRbuState)(unsafe.Pointer(pState)).FzDataTbl) != 0) { rc = _rbuObjIterNext(tls, p, pIter) } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32776, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32861, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow - rc = _rbuObjIterPrepareAll(tls, p, p+80, (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep) + rc = _rbuObjIterPrepareAll(tls, p, p+88, (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -184683,10 +186976,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32225, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32308, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6649, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -184708,7 +187001,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]uint8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32801, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32886, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -184754,7 +187047,8 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain } db = v1 - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32812, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + _ = nVal + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32897, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -184799,11 +187093,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32884, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32969, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32898) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32983) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -184812,7 +187106,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32955) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33040) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -184839,17 +187133,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr } nTarget = v1 nRbu = libc.Xstrlen(tls, zRbu) - nByte = uint64(408) + nTarget + uint64(1) + nRbu + uint64(1) + nByte = uint64(416) + nTarget + uint64(1) + nRbu + uint64(1) p = Xsqlite3_malloc64(tls, nByte) if p != 0 { pState = uintptr(0) /* Create the custom VFS. */ - libc.Xmemset(tls, p, 0, uint64(408)) + libc.Xmemset(tls, p, 0, uint64(416)) Xsqlite3rbu_rename_handler(tls, p, uintptr(0), uintptr(0)) _rbuCreateVfs(tls, p) /* Open the target, RBU and state databases */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - pCsr = p + 1*408 + pCsr = p + 1*416 *(*int32)(unsafe.Pointer(bp)) = 0 if zTarget != 0 { (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget = pCsr @@ -184860,7 +187154,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3859, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3860, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -184885,14 +187179,14 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = (*TRbuState)(unsafe.Pointer(pState)).FeStage (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = (*TRbuState)(unsafe.Pointer(pState)).FnPhaseOneStep } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress = int32((*TRbuState)(unsafe.Pointer(pState)).FnProgress) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress = (*TRbuState)(unsafe.Pointer(pState)).FnProgress (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz = (*TRbuState)(unsafe.Pointer(pState)).FiOalSz } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33029, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33114, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -184914,20 +187208,20 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33061 + v3 = __ccgo_ts + 33146 } else { - v3 = __ccgo_ts + 33068 + v3 = __ccgo_ts + 33153 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33075, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33160, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+14972, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15034, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+80) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) } /* If the RBU database contains no data_xxx tables, declare the RBU ** update finished. */ @@ -184936,21 +187230,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17468) - _rbuCopyPragma(tls, p, __ccgo_ts+16880) + _rbuCopyPragma(tls, p, __ccgo_ts+17533) + _rbuCopyPragma(tls, p, __ccgo_ts+16945) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33107, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33192, uintptr(0), uintptr(0), p+64) } /* 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 (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6649, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33123, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33208, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -184995,9 +187289,9 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr func _rbuMisuseError(tls *libc.TLS) (r uintptr) { var pRet uintptr _ = pRet - pRet = Xsqlite3_malloc64(tls, uint64(408)) + pRet = Xsqlite3_malloc64(tls, uint64(416)) if pRet != 0 { - libc.Xmemset(tls, pRet, 0, uint64(408)) + libc.Xmemset(tls, pRet, 0, uint64(416)) (*Tsqlite3rbu)(unsafe.Pointer(pRet)).Frc = int32(SQLITE_MISUSE) } return pRet @@ -185021,14 +187315,14 @@ 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) (r uintptr) { - var n int32 + var n Tsize_t _ = n if zTarget == uintptr(0) { return _rbuMisuseError(tls) } if zState != 0 { - n = libc.Int32FromUint64(libc.Xstrlen(tls, zState)) - if n >= int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33147, zState+uintptr(n-int32(7)), uint64(7)) { + n = libc.Xstrlen(tls, zState) + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33232, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -185075,7 +187369,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31172, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31255, uint64(8)) == 0 { nDel = int32(8) for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -185103,7 +187397,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+14987, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { @@ -185112,17 +187406,17 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+14987, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ - _rbuObjIterFinalize(tls, p+80) + _rbuObjIterFinalize(tls, p+88) /* If this is an RBU vacuum handle and the vacuum has either finished ** successfully or encountered an error, delete the contents of the ** state table. This causes the next call to sqlite3rbu_vacuum() ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33155, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33240, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -185157,7 +187451,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { // ** current RBU update was started. // */ func Xsqlite3rbu_progress(tls *libc.TLS, pRbu uintptr) (r Tsqlite3_int64) { - return int64((*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FnProgress) + return (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FnProgress } // C documentation @@ -185173,7 +187467,7 @@ func Xsqlite3rbu_bp_progress(tls *libc.TLS, p uintptr, pnOne uintptr, pnTwo uint switch (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage { case int32(RBU_STAGE_OAL): if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep > 0 { - *(*int32)(unsafe.Pointer(pnOne)) = int32(int64(MAX_PROGRESS) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress) / (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep) + *(*int32)(unsafe.Pointer(pnOne)) = int32(int64(MAX_PROGRESS) * (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress / (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep) } else { *(*int32)(unsafe.Pointer(pnOne)) = -int32(1) } @@ -185223,7 +187517,7 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+14987, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ @@ -185236,19 +187530,19 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+14987, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 14972 + v1 = __ccgo_ts + 15034 } else { - v1 = __ccgo_ts + 33107 + v1 = __ccgo_ts + 33192 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33107, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33192, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -185264,6 +187558,7 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r var rc, v1 int32 _, _ = rc, v1 rc = SQLITE_OK + _ = pArg if libc.Xrename(tls, zOld, zNew) != 0 { v1 = int32(SQLITE_IOERR) } else { @@ -185375,7 +187670,7 @@ func _rbuUpdateTempSize(tls *libc.TLS, pFd uintptr, nNew Tsqlite3_int64) (r int3 _, _ = nDiff, pRbu pRbu = (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu nDiff = nNew - (*Trbu_file)(unsafe.Pointer(pFd)).Fsz - *(*Ti64)(unsafe.Pointer(pRbu + 376)) += nDiff + *(*Ti64)(unsafe.Pointer(pRbu + 384)) += nDiff (*Trbu_file)(unsafe.Pointer(pFd)).Fsz = nNew if (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FszTemp > (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FszTempLimit { return int32(SQLITE_FULL) @@ -185814,7 +188109,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xControl})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, int32(SQLITE_FCNTL_ZIPVFS), bp) if rc == SQLITE_OK { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33182, 0) + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33267, 0) } else { if rc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpTargetFd = p @@ -185840,7 +188135,7 @@ func _rbuVfsFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r if rc == SQLITE_OK && op == int32(SQLITE_FCNTL_VFSNAME) { pRbuVfs = (*Trbu_file)(unsafe.Pointer(p)).FpRbuVfs zIn = *(*uintptr)(unsafe.Pointer(pArg)) - zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33205, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) + zOut = Xsqlite3_mprintf(tls, __ccgo_ts+33290, libc.VaList(bp+16, (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).Fbase.FzName, zIn)) *(*uintptr)(unsafe.Pointer(pArg)) = zOut if zOut == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -185900,7 +188195,7 @@ func _rbuVfsShmLock(tls *libc.TLS, pFile uintptr, ofst int32, n int32, flags int if bCapture == 0 || 0 == flags&int32(SQLITE_SHM_UNLOCK) { rc = (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, ofst, n, flags) if bCapture != 0 && rc == SQLITE_OK { - *(*Tu32)(unsafe.Pointer(pRbu + 332)) |= libc.Uint32FromInt32((int32(1)<<n - int32(1)) << ofst) + *(*Tu32)(unsafe.Pointer(pRbu + 340)) |= libc.Uint32FromInt32((int32(1)<<n - int32(1)) << ofst) } } } @@ -186035,7 +188330,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag if pDb != 0 { if (*Trbu_file)(unsafe.Pointer(pDb)).FpRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FeStage == int32(RBU_STAGE_OAL) { if (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FzTarget == uintptr(0) { - zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6649) + zOpen = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(pDb)).FpRbu)).FdbRbu, __ccgo_ts+6711) zOpen = Xsqlite3_filename_wal(tls, zOpen) } nOpen = libc.Xstrlen(tls, zOpen) @@ -186049,7 +188344,7 @@ func _rbuVfsOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFile uintptr, flag } else { (*Trbu_file)(unsafe.Pointer(pFd)).FpRbu = (*Trbu_vfs)(unsafe.Pointer(pRbuVfs)).FpRbu } - if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33216, 0) != 0 { + if oflags&int32(SQLITE_OPEN_MAIN_DB) != 0 && Xsqlite3_uri_boolean(tls, zName, __ccgo_ts+33301, 0) != 0 { oflags = libc.Int32FromInt32(SQLITE_OPEN_TEMP_DB) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_EXCLUSIVE) | libc.Int32FromInt32(SQLITE_OPEN_DELETEONCLOSE) zOpen = uintptr(0) } @@ -186284,6 +188579,9 @@ func _rbuVfsCurrentTime(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) (r int32) // ** No-op. // */ func _rbuVfsGetLastError(tls *libc.TLS, pVfs uintptr, a int32, b uintptr) (r int32) { + _ = pVfs + _ = a + _ = b return 0 } @@ -186602,7 +188900,7 @@ func _statConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint _sqlite3TokenInit(tls, bp, *(*uintptr)(unsafe.Pointer(argv + 3*8))) iDb = _sqlite3FindDb(tls, db, bp) if iDb < 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12316, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+12378, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) return int32(SQLITE_ERROR) } } else { @@ -186714,6 +189012,7 @@ func _statBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).ForderByConsumed = int32(1) *(*int32)(unsafe.Pointer(pIdxInfo + 40)) |= int32(0x08) } + *(*int32)(unsafe.Pointer(pIdxInfo + 80)) |= int32(SQLITE_INDEX_SCAN_HEX) return SQLITE_OK } @@ -187101,7 +189400,7 @@ statNextRestart: (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiPgno = iRoot (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33227, 0) + v1 = Xsqlite3_mprintf(tls, __ccgo_ts+33312, 0) z = v1 (*(*TStatPage)(unsafe.Pointer(pCsr + 24))).FzPath = v1 if z == uintptr(0) { @@ -187139,8 +189438,8 @@ statNextRestart: if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { (*TStatCursor)(unsafe.Pointer(pCsr)).FzName = Xsqlite3_column_text(tls, (*TStatCursor)(unsafe.Pointer(pCsr)).FpStmt, 0) (*TStatCursor)(unsafe.Pointer(pCsr)).FiPageno = *(*Tu32)(unsafe.Pointer((*TStatCell)(unsafe.Pointer(pCell)).FaOvfl + uintptr(iOvfl)*4)) - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33229 - v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33238, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33314 + v2 = Xsqlite3_mprintf(tls, __ccgo_ts+33323, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell, iOvfl)) z = v2 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v2 if z == uintptr(0) { @@ -187169,7 +189468,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage++ if (*TStatCursor)(unsafe.Pointer(pCsr)).FiPage >= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(224196)) + return _sqlite3CorruptError(tls, int32(226027)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -187180,7 +189479,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33250, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33335, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -187203,13 +189502,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33258 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33343 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33267 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33352 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33272 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33357 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -187218,7 +189517,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -187307,12 +189606,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33282, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33367, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33437, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33522, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33451, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33536, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -187389,7 +189688,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33466, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33551, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -187442,7 +189741,13 @@ func init() { ** ** The data field of sqlite_dbpage table can be updated. The new ** value must be a BLOB which is the correct page size, otherwise the -** update fails. Rows may not be deleted or inserted. +** update fails. INSERT operations also work, and operate as if they +** where REPLACE. The size of the database can be extended by INSERT-ing +** new pages on the end. +** +** Rows may not be deleted. However, doing an INSERT to page number N +** with NULL page data causes the N-th page and all subsequent pages to be +** deleted and the database to be truncated. */ /* #include "sqliteInt.h" ** Requires access to internal data structures ** */ @@ -187458,10 +189763,12 @@ type TSessionTable = struct { FpNext uintptr FzName uintptr FnCol int32 + FnTotalCol int32 FbStat1 int32 FbRowid int32 FazCol uintptr FazDflt uintptr + FaiIdx uintptr FabPK uintptr FnEntry int32 FnChange int32 @@ -187571,6 +189878,10 @@ type SessionBuffer1 = TSessionBuffer1 ** input data. Input data may be supplied either as a single large buffer ** (e.g. sqlite3changeset_start()) or using a stream function (e.g. ** sqlite3changeset_start_strm()). +** +** bNoDiscard: +** If true, then the only time data is discarded is as a result of explicit +** sessionDiscardData() calls. Not within every sessionInputBuffer() call. */ type TSessionInput1 = struct { FbNoDiscard int32 @@ -187636,10 +189947,12 @@ type TSessionTable1 = struct { FpNext uintptr FzName uintptr FnCol int32 + FnTotalCol int32 FbStat1 int32 FbRowid int32 FazCol uintptr FazDflt uintptr + FaiIdx uintptr FabPK uintptr FnEntry int32 FnChange int32 @@ -188090,13 +190403,13 @@ func _sessionHashAppendType(tls *libc.TLS, h uint32, eType int32) (r uint32) { func _sessionPreupdateHash(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab uintptr, bNew int32, piHash uintptr, pbNullPK uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - var eType, i, n, rc int32 + var eType, i, iIdx, n, rc int32 var h uint32 var z uintptr var _ /* iVal at bp+8 */ Ti64 var _ /* pVal at bp+0 */ uintptr var _ /* rVal at bp+16 */ float64 - _, _, _, _, _, _ = eType, h, i, n, rc, z + _, _, _, _, _, _, _ = eType, h, i, iIdx, n, rc, z h = uint32(0) /* Used to iterate through columns */ if (*TSessionTable)(unsafe.Pointer(pTab)).FbRowid != 0 { h = _sessionHashAppendI64(tls, h, iRowid) @@ -188107,10 +190420,11 @@ func _sessionPreupdateHash(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab ui break } if *(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 { + iIdx = *(*int32)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FaiIdx + uintptr(i)*4)) if bNew != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iIdx, bp) } else { - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iIdx, bp) } if rc != SQLITE_OK { return rc @@ -188464,12 +190778,12 @@ func _sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab u bp := tls.Alloc(32) defer tls.Free(32) var a, z, v2 uintptr - var eType, iCol, rc int32 + var eType, iCol, iIdx, rc int32 var _ /* iVal at bp+8 */ Ti64 var _ /* n at bp+24 */ int32 var _ /* pVal at bp+0 */ uintptr var _ /* rVal at bp+16 */ float64 - _, _, _, _, _, _ = a, eType, iCol, rc, z, v2 /* Used to iterate through columns */ + _, _, _, _, _, _, _ = a, eType, iCol, iIdx, rc, z, v2 /* Used to iterate through columns */ a = (*TSessionChange)(unsafe.Pointer(pChange)).FaRecord /* Cursor used to scan change record */ if (*TSessionTable)(unsafe.Pointer(pTab)).FbRowid != 0 { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(a))) != int32(SQLITE_INTEGER) { @@ -188488,6 +190802,7 @@ func _sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab u v2 = a a++ /* Error code from preupdate_new/old */ eType = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(v2))) /* Type of value from change record */ + iIdx = *(*int32)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FaiIdx + uintptr(iCol)*4)) /* The following calls to preupdate_new() and preupdate_old() can not ** fail. This is because they cache their return values, and by the ** time control flows to here they have already been called once from @@ -188495,10 +190810,10 @@ func _sessionPreupdateEqual(tls *libc.TLS, pSession uintptr, iRowid Ti64, pTab u ** this (that the method has already been called). */ if op == int32(SQLITE_INSERT) { /* assert( db->pPreUpdate->pNewUnpacked || db->pPreUpdate->aNew ); */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iCol, bp) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iIdx, bp) } else { /* assert( db->pPreUpdate->pUnpacked ); */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iCol, bp) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iIdx, bp) } _ = rc /* Suppress warning about unused variable */ if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(bp))) != eType { @@ -188635,24 +190950,31 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin // ** All returned buffers are part of the same single allocation, which must // ** be freed using sqlite3_free() by the caller // */ -func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, zThis uintptr, pnCol uintptr, pzTab uintptr, pazCol uintptr, pazDflt uintptr, pabPK uintptr, pbRowid uintptr) (r int32) { +func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, zThis uintptr, pnCol uintptr, pnTotalCol uintptr, pzTab uintptr, pazCol uintptr, pazDflt uintptr, paiIdx uintptr, pabPK uintptr, pbRowid uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - var abPK, azCol, azDflt, pAlloc, zDflt, zName, zPragma uintptr + var abPK, aiIdx, azCol, azDflt, pAlloc, zDflt, zName, zPragma uintptr var bRowid, i, nDbCol, nDflt, nName1, nThis, rc int32 var nByte Tsqlite3_int64 var nName Tsize_t var _ /* pStmt at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = abPK, azCol, azDflt, bRowid, i, nByte, nDbCol, nDflt, nName, nName1, nThis, pAlloc, rc, zDflt, zName, zPragma + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = abPK, aiIdx, azCol, azDflt, bRowid, i, nByte, nDbCol, nDflt, nName, nName1, nThis, pAlloc, rc, zDflt, zName, zPragma nDbCol = 0 pAlloc = uintptr(0) azCol = uintptr(0) azDflt = uintptr(0) abPK = uintptr(0) + aiIdx = uintptr(0) bRowid = 0 /* Set to true to use rowid as PK */ *(*uintptr)(unsafe.Pointer(pazCol)) = uintptr(0) *(*uintptr)(unsafe.Pointer(pabPK)) = uintptr(0) *(*int32)(unsafe.Pointer(pnCol)) = 0 + if pnTotalCol != 0 { + *(*int32)(unsafe.Pointer(pnTotalCol)) = 0 + } + if paiIdx != 0 { + *(*uintptr)(unsafe.Pointer(paiIdx)) = uintptr(0) + } if pzTab != 0 { *(*uintptr)(unsafe.Pointer(pzTab)) = uintptr(0) } @@ -188660,20 +190982,20 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11707, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33473, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33558, 0) } else { if rc == int32(SQLITE_ERROR) { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1662, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1663, 0) } else { return rc } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33594, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33688, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -188688,7 +191010,9 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { nByte += int64(Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1))) /* name */ nByte += int64(Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4))) /* dflt_value */ - nDbCol++ + if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(6)) == 0 { /* !hidden */ + nDbCol++ + } if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { bRowid = 0 } /* pk */ @@ -188697,10 +191021,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29815)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29898)) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -188711,8 +191035,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, if rc == SQLITE_OK { azCol = pAlloc azDflt = azCol + uintptr(nDbCol)*8 - pAlloc = azDflt + uintptr(nDbCol)*8 - abPK = pAlloc + aiIdx = azDflt + uintptr(nDbCol)*8 + abPK = aiIdx + uintptr(nDbCol)*4 pAlloc = abPK + uintptr(nDbCol) if pzTab != 0 { libc.Xmemcpy(tls, pAlloc, zThis, libc.Uint64FromInt32(nThis+int32(1))) @@ -188721,33 +191045,40 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29815) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29815, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29898) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29898, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) + *(*int32)(unsafe.Pointer(aiIdx + uintptr(i)*4)) = -int32(1) i++ } for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - nName1 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - nDflt = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) - zName = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - zDflt = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) - if zName == uintptr(0) { - break + if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(6)) == 0 { /* !hidden */ + nName1 = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) + nDflt = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) + zName = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) + zDflt = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) + if zName == uintptr(0) { + break + } + libc.Xmemcpy(tls, pAlloc, zName, libc.Uint64FromInt32(nName1+int32(1))) + *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc + pAlloc += uintptr(nName1 + int32(1)) + if zDflt != 0 { + libc.Xmemcpy(tls, pAlloc, zDflt, libc.Uint64FromInt32(nDflt+int32(1))) + *(*uintptr)(unsafe.Pointer(azDflt + uintptr(i)*8)) = pAlloc + pAlloc += uintptr(nDflt + int32(1)) + } else { + *(*uintptr)(unsafe.Pointer(azDflt + uintptr(i)*8)) = uintptr(0) + } + *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = libc.Uint8FromInt32(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5))) + *(*int32)(unsafe.Pointer(aiIdx + uintptr(i)*4)) = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) + i++ } - libc.Xmemcpy(tls, pAlloc, zName, libc.Uint64FromInt32(nName1+int32(1))) - *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc - pAlloc += uintptr(nName1 + int32(1)) - if zDflt != 0 { - libc.Xmemcpy(tls, pAlloc, zDflt, libc.Uint64FromInt32(nDflt+int32(1))) - *(*uintptr)(unsafe.Pointer(azDflt + uintptr(i)*8)) = pAlloc - pAlloc += uintptr(nDflt + int32(1)) - } else { - *(*uintptr)(unsafe.Pointer(azDflt + uintptr(i)*8)) = uintptr(0) + if pnTotalCol != 0 { + *(*int32)(unsafe.Pointer(pnTotalCol))++ } - *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = libc.Uint8FromInt32(Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5))) - i++ } rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) } @@ -188761,6 +191092,9 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } *(*uintptr)(unsafe.Pointer(pabPK)) = abPK *(*int32)(unsafe.Pointer(pnCol)) = nDbCol + if paiIdx != 0 { + *(*uintptr)(unsafe.Pointer(paiIdx)) = aiIdx + } } else { _sessionFree(tls, pSession, azCol) } @@ -188794,11 +191128,11 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = pTab + 24 + v1 = pTab + 28 } else { v1 = uintptr(0) } - rc = _sessionTableInfo(tls, pSession, db, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, pTab+16, uintptr(0), pTab+32, pTab+40, bp, v1) + rc = _sessionTableInfo(tls, pSession, db, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, pTab+16, pTab+20, uintptr(0), pTab+32, pTab+40, pTab+48, bp, v1) if rc == SQLITE_OK { i = 0 for { @@ -188814,7 +191148,7 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11707, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -188840,25 +191174,29 @@ func _sessionReinitTable(tls *libc.TLS, pSession uintptr, pTab uintptr) (r int32 defer tls.Free(48) var a, v1 uintptr var ii, nOldCol int32 - var _ /* abPK at bp+24 */ uintptr + var _ /* abPK at bp+32 */ uintptr + var _ /* aiIdx at bp+24 */ uintptr var _ /* azCol at bp+8 */ uintptr var _ /* azDflt at bp+16 */ uintptr - var _ /* bRowid at bp+32 */ int32 + var _ /* bRowid at bp+40 */ int32 var _ /* nCol at bp+0 */ int32 + var _ /* nTotalCol at bp+4 */ int32 _, _, _, _ = a, ii, nOldCol, v1 *(*int32)(unsafe.Pointer(bp)) = 0 + *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) - *(*int32)(unsafe.Pointer(bp + 32)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 40)) = 0 if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 32 + v1 = bp + 40 } else { v1 = uintptr(0) } - (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc = _sessionTableInfo(tls, pSession, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, bp, uintptr(0), bp+8, bp+16, bp+24, v1) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc = _sessionTableInfo(tls, pSession, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, bp, bp+4, uintptr(0), bp+8, bp+16, bp+24, bp+32, v1) if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc == SQLITE_OK { - if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol > *(*int32)(unsafe.Pointer(bp)) || (*TSessionTable)(unsafe.Pointer(pTab)).FbRowid != *(*int32)(unsafe.Pointer(bp + 32)) { + if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol > *(*int32)(unsafe.Pointer(bp)) || (*TSessionTable)(unsafe.Pointer(pTab)).FbRowid != *(*int32)(unsafe.Pointer(bp + 40)) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc = int32(SQLITE_SCHEMA) } else { nOldCol = (*TSessionTable)(unsafe.Pointer(pTab)).FnCol @@ -188868,11 +191206,11 @@ func _sessionReinitTable(tls *libc.TLS, pSession uintptr, pTab uintptr) (r int32 break } if ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol { - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii)))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + uintptr(ii)))) { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(ii)))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(ii)))) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc = int32(SQLITE_SCHEMA) } } else { - if *(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)) + uintptr(ii))) != 0 { + if *(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(ii))) != 0 { (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc = int32(SQLITE_SCHEMA) } } @@ -188885,8 +191223,10 @@ func _sessionReinitTable(tls *libc.TLS, pSession uintptr, pTab uintptr) (r int32 a = (*TSessionTable)(unsafe.Pointer(pTab)).FazCol (*TSessionTable)(unsafe.Pointer(pTab)).FazCol = *(*uintptr)(unsafe.Pointer(bp + 8)) (*TSessionTable)(unsafe.Pointer(pTab)).FnCol = *(*int32)(unsafe.Pointer(bp)) + (*TSessionTable)(unsafe.Pointer(pTab)).FnTotalCol = *(*int32)(unsafe.Pointer(bp + 4)) (*TSessionTable)(unsafe.Pointer(pTab)).FazDflt = *(*uintptr)(unsafe.Pointer(bp + 16)) - (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = *(*uintptr)(unsafe.Pointer(bp + 24)) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = *(*uintptr)(unsafe.Pointer(bp + 32)) + (*TSessionTable)(unsafe.Pointer(pTab)).FaiIdx = *(*uintptr)(unsafe.Pointer(bp + 24)) *(*uintptr)(unsafe.Pointer(bp + 8)) = a } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -189103,10 +191443,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11327 + zSep = __ccgo_ts + 11389 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33623, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33718, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -189115,11 +191455,11 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin if *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) != 0 { v2 = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1664 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5140, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15083 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5141, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15145 goto _1 _1: ; @@ -189258,7 +191598,7 @@ func _sessionStat1Depth(tls *libc.TLS, pCtx uintptr) (r int32) { func _sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintptr, pC uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var bChanged, eType, ii, ii1, nIncr, nOld int32 + var bChanged, eType, iIdx, ii, ii1, nIncr, nOld int32 var pCsr, v3 uintptr var _ /* dVal at bp+32 */ float64 var _ /* iVal at bp+24 */ Tsqlite3_int64 @@ -189266,7 +191606,7 @@ func _sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintp var _ /* nNew at bp+0 */ Ti64 var _ /* p at bp+16 */ uintptr var _ /* p at bp+8 */ uintptr - _, _, _, _, _, _, _, _ = bChanged, eType, ii, ii1, nIncr, nOld, pCsr, v3 + _, _, _, _, _, _, _, _, _ = bChanged, eType, iIdx, ii, ii1, nIncr, nOld, pCsr, v3 *(*Ti64)(unsafe.Pointer(bp)) = int64(2) if libc.Int32FromUint8((*TSessionChange)(unsafe.Pointer(pC)).Fop) == int32(SQLITE_INSERT) { if (*TSessionTable)(unsafe.Pointer(pTab)).FbRowid != 0 { @@ -189279,7 +191619,7 @@ func _sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintp break } *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, ii, bp+8) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, *(*int32)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FaiIdx + uintptr(ii)*4)), bp+8) _sessionSerializeValue(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 8)), bp) goto _1 _1: @@ -189306,8 +191646,9 @@ func _sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintp } bChanged = int32(1) nOld = 0 + iIdx = *(*int32)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FaiIdx + uintptr(ii1)*4)) *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, ii1-(*TSessionTable)(unsafe.Pointer(pTab)).FbRowid, bp+16) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iIdx, bp+16) if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -189383,7 +191724,7 @@ func _sessionUpdateMaxSize(tls *libc.TLS, op int32, pSession uintptr, pTab uintp func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession uintptr, pTab uintptr) { bp := tls.Alloc(80) defer tls.Free(80) - var i, nExpect, rc int32 + var i, iIdx, iIdx1, nExpect, rc int32 var p, pC uintptr var _ /* bNull at bp+4 */ int32 var _ /* iHash at bp+0 */ int32 @@ -189391,7 +191732,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u var _ /* p at bp+64 */ uintptr var _ /* p at bp+72 */ uintptr var _ /* stat1 at bp+8 */ TSessionStat1Ctx - _, _, _, _, _ = i, nExpect, p, pC, rc + _, _, _, _, _, _, _ = i, iIdx, iIdx1, nExpect, p, pC, rc *(*int32)(unsafe.Pointer(bp + 4)) = 0 rc = SQLITE_OK nExpect = 0 @@ -189406,7 +191747,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u /* Check the number of columns in this xPreUpdate call matches the ** number of columns in the table. */ nExpect = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxCount})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx) - if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol-(*TSessionTable)(unsafe.Pointer(pTab)).FbRowid < nExpect { + if (*TSessionTable)(unsafe.Pointer(pTab)).FnTotalCol < nExpect { if _sessionReinitTable(tls, pSession, pTab) != 0 { return } @@ -189414,7 +191755,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u return } } - if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol-(*TSessionTable)(unsafe.Pointer(pTab)).FbRowid != nExpect { + if (*TSessionTable)(unsafe.Pointer(pTab)).FnTotalCol != nExpect { (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc = int32(SQLITE_SCHEMA) return } @@ -189437,7 +191778,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u rc = int32(SQLITE_NOMEM) goto error_out } - _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1662, uint8(0), libc.UintptrFromInt32(0)) + _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1663, uint8(0), libc.UintptrFromInt32(0)) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p } } @@ -189466,22 +191807,27 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u (*TSessionTable)(unsafe.Pointer(pTab)).FnEntry++ /* Figure out how large an allocation is required */ *(*Tsqlite3_int64)(unsafe.Pointer(bp + 56)) = int64(32) - i = 0 + i = (*TSessionTable)(unsafe.Pointer(pTab)).FbRowid for { - if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol-(*TSessionTable)(unsafe.Pointer(pTab)).FbRowid) { + if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { break } + iIdx = *(*int32)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FaiIdx + uintptr(i)*4)) *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) if op != int32(SQLITE_INSERT) { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp+64) + /* This may fail if the column has a non-NULL default and was added + ** using ALTER TABLE ADD COLUMN after this record was created. */ + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iIdx, bp+64) } else { if *(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp+64) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iIdx, bp+64) } } - /* This may fail if SQLite value p contains a utf-16 string that must - ** be converted to utf-8 and an OOM error occurs while doing so. */ - rc = _sessionSerializeValue(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 64)), bp+56) + if rc == SQLITE_OK { + /* This may fail if SQLite value p contains a utf-16 string that must + ** be converted to utf-8 and an OOM error occurs while doing so. */ + rc = _sessionSerializeValue(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(bp + 64)), bp+56) + } if rc != SQLITE_OK { goto error_out } @@ -189512,17 +191858,18 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u _sessionPutI64(tls, (*TSessionChange)(unsafe.Pointer(pC)).FaRecord+1, iRowid) *(*Tsqlite3_int64)(unsafe.Pointer(bp + 56)) = int64(9) } - i = 0 + i = (*TSessionTable)(unsafe.Pointer(pTab)).FbRowid for { - if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol-(*TSessionTable)(unsafe.Pointer(pTab)).FbRowid) { + if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { break } *(*uintptr)(unsafe.Pointer(bp + 72)) = uintptr(0) + iIdx1 = *(*int32)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FaiIdx + uintptr(i)*4)) if op != int32(SQLITE_INSERT) { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp+72) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxOld})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iIdx1, bp+72) } else { if *(*Tu8)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(i))) != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, i, bp+72) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FxNew})))(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fhook.FpCtx, iIdx1, bp+72) } } _sessionSerializeValue(tls, (*TSessionChange)(unsafe.Pointer(pC)).FaRecord+uintptr(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 56))), *(*uintptr)(unsafe.Pointer(bp + 72)), bp+56) @@ -189758,7 +192105,7 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr var i int32 var zRet, zSep uintptr _, _, _ = i, zRet, zSep - zSep = __ccgo_ts + 1662 + zSep = __ccgo_ts + 1663 zRet = uintptr(0) i = 0 for { @@ -189766,8 +192113,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33630, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22158 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33725, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22230 if zRet == uintptr(0) { break } @@ -189786,7 +192133,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint var bHave, i int32 var zRet, zSep uintptr _, _, _, _ = bHave, i, zRet, zSep - zSep = __ccgo_ts + 1662 + zSep = __ccgo_ts + 1663 zRet = uintptr(0) bHave = 0 i = 0 @@ -189796,8 +192143,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33664, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 33705 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33759, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 33800 if zRet == uintptr(0) { break } @@ -189808,7 +192155,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1782, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1783, 0) } return zRet } @@ -189819,12 +192166,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33710 + v1 = __ccgo_ts + 33805 } else { - v1 = __ccgo_ts + 6654 + v1 = __ccgo_ts + 6716 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33721, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33816, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -189885,11 +192232,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15083 + v2 = __ccgo_ts + 15145 } else { - v2 = __ccgo_ts + 1662 + v2 = __ccgo_ts + 1663 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33800, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33895, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -189917,7 +192264,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33819, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33914, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -189988,7 +192335,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u } else { v1 = uintptr(0) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), bp+40, uintptr(0), bp+32, v1) + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { bMismatch = int32(1) @@ -190017,7 +192364,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33876, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33971, 0) } rc = int32(SQLITE_SCHEMA) } @@ -190225,13 +192572,13 @@ func Xsqlite3session_attach(tls *libc.TLS, pSession uintptr, zName uintptr) (r i } if !(pTab != 0) { /* Allocate new SessionTable object. */ - nByte = libc.Int32FromUint64(uint64(80) + libc.Uint64FromInt32(nName) + uint64(1)) + nByte = libc.Int32FromUint64(uint64(88) + libc.Uint64FromInt32(nName) + uint64(1)) pTab = _sessionMalloc64(tls, pSession, int64(nByte)) if !(pTab != 0) { rc = int32(SQLITE_NOMEM) } else { - libc.Xmemset(tls, pTab, 0, uint64(80)) - (*TSessionTable)(unsafe.Pointer(pTab)).FzName = pTab + 1*80 + libc.Xmemset(tls, pTab, 0, uint64(88)) + (*TSessionTable)(unsafe.Pointer(pTab)).FzName = pTab + 1*88 libc.Xmemcpy(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zName, libc.Uint64FromInt32(nName+int32(1))) ppTab = pSession + 88 for { @@ -190349,7 +192696,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]uint8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5202, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5203, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -190375,17 +192722,19 @@ func _sessionAppendIdent(tls *libc.TLS, p uintptr, zStr uintptr, pRc uintptr) { v1 = zOut zOut++ *(*uint8)(unsafe.Pointer(v1)) = uint8('"') - for *(*uint8)(unsafe.Pointer(zIn)) != 0 { - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn))) == int32('"') { - v2 = zOut + if zIn != uintptr(0) { + for *(*uint8)(unsafe.Pointer(zIn)) != 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn))) == int32('"') { + v2 = zOut + zOut++ + *(*uint8)(unsafe.Pointer(v2)) = uint8('"') + } + v3 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v2)) = uint8('"') + v4 = zIn + zIn++ + *(*uint8)(unsafe.Pointer(v3)) = *(*uint8)(unsafe.Pointer(v4)) } - v3 = zOut - zOut++ - v4 = zIn - zIn++ - *(*uint8)(unsafe.Pointer(v3)) = *(*uint8)(unsafe.Pointer(v4)) } v5 = zOut zOut++ @@ -190629,62 +192978,62 @@ func _sessionAppendDelete(tls *libc.TLS, pBuf uintptr, bPatchset int32, p uintpt // ** for each non-pk <column>. // */ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintptr, zTab uintptr, bRowid int32, nCol int32, azCol uintptr, abPK uintptr, ppStmt uintptr) (r int32) { - bp := tls.Alloc(112) - defer tls.Free(112) + bp := tls.Alloc(128) + defer tls.Free(128) var i, nSql int32 - var zCols, zSep, zSql, v1, v3 uintptr - var _ /* nooptest at bp+8 */ TSessionBuffer - var _ /* pkfield at bp+24 */ TSessionBuffer - var _ /* pkvar at bp+40 */ TSessionBuffer + var zSep, zSql, v2 uintptr + var _ /* cols at bp+8 */ TSessionBuffer + var _ /* nooptest at bp+24 */ TSessionBuffer + var _ /* pkfield at bp+40 */ TSessionBuffer + var _ /* pkvar at bp+56 */ TSessionBuffer var _ /* rc at bp+0 */ int32 - _, _, _, _, _, _, _ = i, nSql, zCols, zSep, zSql, v1, v3 + _, _, _, _, _ = i, nSql, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK zSql = uintptr(0) - zSep = __ccgo_ts + 1662 - if bRowid != 0 { - v1 = __ccgo_ts + 33710 - } else { - v1 = __ccgo_ts + 6654 - } - zCols = v1 + zSep = __ccgo_ts + 1663 nSql = -int32(1) *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+33903, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11707, zTab) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+33907, bp) - _sessionAppendStr(tls, bp+24, __ccgo_ts+33931, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+33940, bp) - zCols = __ccgo_ts + 33985 + *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} + _sessionAppendStr(tls, bp+24, __ccgo_ts+33998, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34002, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34026, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34035, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34080, bp) } else { i = 0 for { if !(i < nCol) { break } + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { + _sessionAppendStr(tls, bp+8, __ccgo_ts+15145, bp) + } + _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - _sessionAppendStr(tls, bp+24, zSep, bp) _sessionAppendStr(tls, bp+40, zSep, bp) - zSep = __ccgo_ts + 15083 - _sessionAppendIdent(tls, bp+24, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+33999, libc.VaList(bp+64, i+int32(1))) + _sessionAppendStr(tls, bp+56, zSep, bp) + zSep = __ccgo_ts + 15145 + _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34094, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+8, bp, __ccgo_ts+34003, libc.VaList(bp+64, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34098, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } - goto _2 - _2: + goto _1 + _1: ; i++ } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if bIgnoreNoop != 0 { - v3 = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf + v2 = (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf } else { - v3 = __ccgo_ts + 1662 + v2 = __ccgo_ts + 1663 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34030, libc.VaList(bp+64, zCols, v3, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34125, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -190693,9 +193042,10 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, zSql, nSql, ppStmt, uintptr(0)) } Xsqlite3_free(tls, zSql) - Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf) Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf) + Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf) + Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf) return *(*int32)(unsafe.Pointer(bp)) } @@ -190825,7 +193175,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34072, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34167, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -190931,7 +193281,7 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34092, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34187, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -191348,7 +193698,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(228345)) + rc = _sqlite3CorruptError(tls, int32(230283)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -191372,7 +193722,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(228365)) + rc = _sqlite3CorruptError(tls, int32(230303)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -191387,7 +193737,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(228375)) + rc = _sqlite3CorruptError(tls, int32(230313)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -191443,7 +193793,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(228423)) + rc = _sqlite3CorruptError(tls, int32(230361)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -191548,7 +193898,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(228511)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -191654,7 +194004,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(228597)) + v7 = _sqlite3CorruptError(tls, int32(230535)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -191664,7 +194014,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(228603)) + v10 = _sqlite3CorruptError(tls, int32(230541)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -191743,7 +194093,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(228647)) + v16 = _sqlite3CorruptError(tls, int32(230585)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -192153,7 +194503,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(229012)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) goto finished_invert } if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { @@ -192356,18 +194706,18 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11707) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11769) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - zSep = __ccgo_ts + 1662 + zSep = __ccgo_ts + 1663 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34110, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34205, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34123, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34218, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -192377,9 +194727,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34129, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34224, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15083 + zSep = __ccgo_ts + 15145 } goto _2 _2: @@ -192387,8 +194737,8 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 ii++ } /* Create the WHERE clause part of the UPDATE */ - zSep = __ccgo_ts + 1662 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34134, bp) + zSep = __ccgo_ts + 1663 + _sessionAppendStr(tls, bp+8, __ccgo_ts+34229, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -192397,13 +194747,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34142, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34237, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34217, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34312, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22158 + zSep = __ccgo_ts + 22230 } goto _3 _3: @@ -192486,13 +194836,13 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in var _ /* buf at bp+8 */ TSessionBuffer var _ /* rc at bp+0 */ int32 _, _, _ = i, nPk, zSep - zSep = __ccgo_ts + 1662 + zSep = __ccgo_ts + 1663 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34223, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34318, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34134, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34229, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -192502,9 +194852,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34129, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34224, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22158 + zSep = __ccgo_ts + 22230 } goto _1 _1: @@ -192512,10 +194862,10 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34241, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34336, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33705, bp) - zSep = __ccgo_ts + 1662 + _sessionAppendStr(tls, bp+8, __ccgo_ts+33800, bp) + zSep = __ccgo_ts + 1663 i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -192524,16 +194874,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34217, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34312, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34249 + zSep = __ccgo_ts + 34344 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5170, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5171, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -192559,7 +194909,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6649, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6711, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -192582,16 +194932,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34254, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34349, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22164, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22236, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15083, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15145, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -192599,19 +194949,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34272, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34367, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34283, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34378, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5170, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5171, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -192634,12 +194984,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11707, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11769, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34287) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34382) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34400) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34495) } return rc } @@ -192705,7 +195055,7 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(229494)) + rc = _sqlite3CorruptError(tls, int32(231432)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -193121,7 +195471,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34544, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34639, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -193134,7 +195484,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34565, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34660, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -193205,7 +195555,8 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) - var bPatchset, i, nMinCol, nTab, rc, res, schemaMismatch, v2, v3, v4, v6 int32 + var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 + var savedFlag Tu64 var v5, v7 bool var _ /* abPK at bp+152 */ uintptr var _ /* nCol at bp+136 */ int32 @@ -193216,22 +195567,27 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui var _ /* sIter at bp+168 */ Tsqlite3_changeset_iter var _ /* zNew at bp+144 */ uintptr var _ /* zTab at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _ = bPatchset, i, nMinCol, nTab, rc, res, schemaMismatch, v2, v3, v4, v5, v6, v7 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bPatchset, i, nMinCol, nTab, rc, rc2, res, savedFlag, schemaMismatch, v2, v3, v4, v5, v6, v7 schemaMismatch = 0 rc = SQLITE_OK /* Return code */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Name of current table */ nTab = 0 + savedFlag = (*Tsqlite3)(unsafe.Pointer(db)).Fflags & (libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32)) + Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, db)) + if flags&int32(SQLITE_CHANGESETAPPLY_FKNOACTION) != 0 { + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32) + *(*int32)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)) -= int32(32) + } (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) libc.Xmemset(tls, bp+8, 0, uint64(128)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase = libc.BoolUint8(ppRebase != 0 && pnRebase != 0) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) - Xsqlite3_mutex_enter(tls, Xsqlite3_db_mutex(tls, db)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34584, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34679, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34610, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34705, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) @@ -193262,7 +195618,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui ** non-zero, proceed. */ schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -193272,7 +195628,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6649, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, bp, bp+8+40, uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6711, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -193291,18 +195647,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34640, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34735, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34684, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34779, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34755, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34850, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11707) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11769) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -193359,13 +195715,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } } } - Xsqlite3_exec(tls, db, __ccgo_ts+34815, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34910, uintptr(0), uintptr(0), uintptr(0)) + if rc == SQLITE_OK { + rc = rc2 + } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) - } else { - Xsqlite3_exec(tls, db, __ccgo_ts+34869, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34940, uintptr(0), uintptr(0), uintptr(0)) + } + if rc != SQLITE_OK { + Xsqlite3_exec(tls, db, __ccgo_ts+34964, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34940, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -193380,6 +195740,10 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3_free(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FazCol) /* cast works around VC++ bug */ Xsqlite3_free(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).Fconstraints.FaBuf) Xsqlite3_free(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).Frebase.FaBuf) + if flags&int32(SQLITE_CHANGESETAPPLY_FKNOACTION) != 0 && savedFlag == uint64(0) { + *(*Tu64)(unsafe.Pointer(db + 48)) &= ^(libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32)) + *(*int32)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)) -= int32(32) + } Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return rc } @@ -193394,23 +195758,13 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 - var savedFlag Tu64 var _ /* pIter at bp+0 */ uintptr - _, _, _ = bInv, rc, savedFlag /* Iterator to skip through changeset */ + _, _ = bInv, rc /* Iterator to skip through changeset */ bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) - savedFlag = (*Tsqlite3)(unsafe.Pointer(db)).Fflags & (libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32)) - if flags&int32(SQLITE_CHANGESETAPPLY_FKNOACTION) != 0 { - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32) - *(*int32)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)) -= int32(32) - } if rc == SQLITE_OK { rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) } - if flags&int32(SQLITE_CHANGESETAPPLY_FKNOACTION) != 0 && savedFlag == uint64(0) { - *(*Tu64)(unsafe.Pointer(db + 48)) &= ^(libc.Uint64FromInt32(libc.Int32FromInt32(0x00008)) << libc.Int32FromInt32(32)) - *(*int32)(unsafe.Pointer((*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema)) -= int32(32) - } return rc } @@ -193720,7 +196074,10 @@ func _sessionChangesetExtendRecord(tls *libc.TLS, pGrp uintptr, pTab uintptr, nC /* Append the missing default column values to the record. */ _sessionAppendBlob(tls, pOut, aRec, nRec, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TSessionTable)(unsafe.Pointer(pTab)).FpDfltStmt == uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = _sessionPrepareDfltStmt(tls, (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).Fdb, pTab, pTab+72) + *(*int32)(unsafe.Pointer(bp)) = _sessionPrepareDfltStmt(tls, (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).Fdb, pTab, pTab+80) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) != Xsqlite3_step(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FpDfltStmt) { + *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_errcode(tls, (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).Fdb) + } } ii = nCol for { @@ -193741,6 +196098,7 @@ func _sessionChangesetExtendRecord(tls *libc.TLS, pGrp uintptr, pTab uintptr, nC } if SQLITE_OK == _sessionBufferGrow(tls, pOut, int64(8), bp) { _sessionPutI64(tls, (*TSessionBuffer)(unsafe.Pointer(pOut)).FaBuf+uintptr((*TSessionBuffer)(unsafe.Pointer(pOut)).FnBuf), *(*Ti64)(unsafe.Pointer(bp + 8))) + *(*int32)(unsafe.Pointer(pOut + 8)) += int32(8) } case int32(SQLITE_BLOB): fallthrough @@ -193851,13 +196209,13 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(80)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) if !(pTab != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pTab, 0, uint64(80)) + libc.Xmemset(tls, pTab, 0, uint64(88)) (*TSessionTable)(unsafe.Pointer(pTab)).FnCol = *(*int32)(unsafe.Pointer(bp + 8)) - (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = pTab + 1*80 + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = pTab + 1*88 libc.Xmemcpy(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FabPK, *(*uintptr)(unsafe.Pointer(bp)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) (*TSessionTable)(unsafe.Pointer(pTab)).FzName = (*TSessionTable)(unsafe.Pointer(pTab)).FabPK + uintptr(*(*int32)(unsafe.Pointer(bp + 8))) libc.Xmemcpy(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zTab, libc.Uint64FromInt32(nTab+int32(1))) @@ -194001,6 +196359,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase var _ /* nRec at bp+8 */ int32 _ = rc rc = SQLITE_OK + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) for int32(SQLITE_ROW) == _sessionChangesetNext(tls, pIter, bp, bp+8, uintptr(0)) { rc = _sessionOneChangeToHash(tls, pGrp, pIter, bRebase) if rc != SQLITE_OK { @@ -194142,7 +196501,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -194708,6 +197067,28 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /************** Begin file fts5.c ********************************************/ /* +** This, the "fts5.c" source file, is a composite file that is itself +** assembled from the following files: +** +** fts5.h +** fts5Int.h +** fts5parse.h <--- Generated from fts5parse.y by Lemon +** fts5parse.c <--- Generated from fts5parse.y by Lemon +** fts5_aux.c +** fts5_buffer.c +** fts5_config.c +** fts5_expr.c +** fts5_hash.c +** fts5_index.c +** fts5_main.c +** fts5_storage.c +** fts5_tokenize.c +** fts5_unicode2.c +** fts5_varint.c +** fts5_vocab.c + */ + +/* ** 2014 May 31 ** ** The author disclaims copyright to this source code. In place of @@ -194777,13 +197158,14 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { ** warnings. */ type TFts5Global = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr + Fapi Tfts5_api + Fdb uintptr + FiNextId Ti64 + FpAux uintptr + FpTok uintptr + FpDfltTok uintptr + FpCsr uintptr + FaLocaleHdr [4]Tu32 } type Fts5Global = TFts5Global @@ -194814,42 +197196,70 @@ type Fts5Colset1 = TFts5Colset1 */ type TFts5Config = struct { - Fdb uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FeDetail int32 - FzContentExprlist uintptr - FpTok uintptr - FpTokApi uintptr - FbLock int32 - FePattern int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FpzErrmsg uintptr + Fdb uintptr + FpGlobal uintptr + FzDb uintptr + FzName uintptr + FnCol int32 + FazCol uintptr + FabUnindexed uintptr + FnPrefix int32 + FaPrefix uintptr + FeContent int32 + FbContentlessDelete int32 + FbContentlessUnindexed int32 + FzContent uintptr + FzContentRowid uintptr + FbColumnsize int32 + FbTokendata int32 + FbLocale int32 + FeDetail int32 + FzContentExprlist uintptr + Ft TFts5TokenizerConfig + FbLock int32 + FiVersion int32 + FiCookie int32 + Fpgsz int32 + FnAutomerge int32 + FnCrisisMerge int32 + FnUsermerge int32 + FnHashSize int32 + FzRank uintptr + FzRankArgs uintptr + FbSecureDelete int32 + FnDeleteMerge int32 + FbPrefixInsttoken int32 + FpzErrmsg uintptr } type Fts5Config = TFts5Config +type TFts5TokenizerConfig = struct { + FpTok uintptr + FpApi2 uintptr + FpApi1 uintptr + FazArg uintptr + FnArg int32 + FePattern int32 + FpLocale uintptr + FnLocale int32 +} + +type Fts5TokenizerConfig = TFts5TokenizerConfig + +type TFts5TokenizerConfig1 = struct { + FpTok uintptr + FpApi2 uintptr + FpApi1 uintptr + FazArg uintptr + FnArg int32 + FePattern int32 + FpLocale uintptr + FnLocale int32 +} + +type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 + /* ** An instance of the following structure encodes all information that can ** be gleaned from the CREATE VIRTUAL TABLE statement. @@ -194888,40 +197298,44 @@ type Fts5Config = TFts5Config ** ** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); ** +** bLocale: +** Set to true if locale=1 was specified when the table was created. */ type TFts5Config1 = struct { - Fdb uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FeDetail int32 - FzContentExprlist uintptr - FpTok uintptr - FpTokApi uintptr - FbLock int32 - FePattern int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FpzErrmsg uintptr + Fdb uintptr + FpGlobal uintptr + FzDb uintptr + FzName uintptr + FnCol int32 + FazCol uintptr + FabUnindexed uintptr + FnPrefix int32 + FaPrefix uintptr + FeContent int32 + FbContentlessDelete int32 + FbContentlessUnindexed int32 + FzContent uintptr + FzContentRowid uintptr + FbColumnsize int32 + FbTokendata int32 + FbLocale int32 + FeDetail int32 + FzContentExprlist uintptr + Ft TFts5TokenizerConfig + FbLock int32 + FiVersion int32 + FiCookie int32 + Fpgsz int32 + FnAutomerge int32 + FnCrisisMerge int32 + FnUsermerge int32 + FnHashSize int32 + FzRank uintptr + FzRankArgs uintptr + FbSecureDelete int32 + FnDeleteMerge int32 + FbPrefixInsttoken int32 + FpzErrmsg uintptr } type Fts5Config1 = TFts5Config1 @@ -195117,7 +197531,8 @@ type TFts5Storage = struct { FbTotalsValid int32 FnTotalRow Ti64 FaTotalSize uintptr - FaStmt [11]uintptr + FpSavedRow uintptr + FaStmt [12]uintptr } type Fts5Storage = TFts5Storage @@ -196034,7 +198449,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34897, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34992, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -196390,7 +198805,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34925, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35020, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -196674,7 +199089,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+34956, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35051, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -196763,15 +199178,17 @@ func _fts5HighlightCb(tls *libc.TLS, pContext uintptr, tflags int32, pToken uint // ** Implementation of highlight() function. // */ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { - bp := tls.Alloc(112) - defer tls.Free(112) + bp := tls.Alloc(128) + defer tls.Free(128) var iCol int32 var zErr uintptr var _ /* ctx at bp+0 */ THighlightContext + var _ /* nLoc at bp+120 */ int32 + var _ /* pLoc at bp+112 */ uintptr var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 34963 + zErr = __ccgo_ts + 35058 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -196782,15 +199199,20 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint (*(*THighlightContext)(unsafe.Pointer(bp))).FiRangeEnd = -int32(1) *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, iCol, bp+24, bp+32) if *(*int32)(unsafe.Pointer(bp + 104)) == int32(SQLITE_RANGE) { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1662, -int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1663, -int32(1), libc.UintptrFromInt32(0)) *(*int32)(unsafe.Pointer(bp + 104)) = SQLITE_OK } else { if (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn != 0 { + *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) /* Locale of column iCol */ + *(*int32)(unsafe.Pointer(bp + 120)) = 0 /* Size of pLoc in bytes */ if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 104)) = _fts5CInstIterInit(tls, pApi, pFts, iCol, bp+40) } if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize})))(tls, pFts, (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn, (*(*THighlightContext)(unsafe.Pointer(bp))).FnIn, bp, __ccgo_fp(_fts5HighlightCb)) + *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnLocale})))(tls, pFts, iCol, bp+112, bp+120) + } + if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK { + *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize_v2})))(tls, pFts, (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn, (*(*THighlightContext)(unsafe.Pointer(bp))).FnIn, *(*uintptr)(unsafe.Pointer(bp + 112)), *(*int32)(unsafe.Pointer(bp + 120)), bp, __ccgo_fp(_fts5HighlightCb)) } if (*(*THighlightContext)(unsafe.Pointer(bp))).FbOpen != 0 { _fts5HighlightAppend(tls, bp+104, bp, (*(*THighlightContext)(unsafe.Pointer(bp))).FzClose, -int32(1)) @@ -196983,7 +199405,7 @@ func _fts5ValueToText(tls *libc.TLS, pVal uintptr) (r uintptr) { if zRet != 0 { v1 = zRet } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } return v1 } @@ -196994,20 +199416,24 @@ func _fts5ValueToText(tls *libc.TLS, pVal uintptr) (r uintptr) { // ** Implementation of snippet() function. // */ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { - bp := tls.Alloc(192) - defer tls.Free(192) + bp := tls.Alloc(208) + defer tls.Free(208) var aSeen, zEllips, zErr uintptr var i, iBestCol, iBestStart, iCol, ii, jj, nBestScore, nCol, nPhrase, nToken, v1, v5 int32 var _ /* ctx at bp+0 */ THighlightContext - var _ /* iAdj at bp+172 */ int32 - var _ /* ic at bp+164 */ int32 - var _ /* io at bp+168 */ int32 - var _ /* ip at bp+160 */ int32 + var _ /* iAdj at bp+184 */ int32 + var _ /* ic at bp+176 */ int32 + var _ /* io at bp+180 */ int32 + var _ /* ip at bp+172 */ int32 var _ /* nColSize at bp+112 */ int32 - var _ /* nDoc at bp+152 */ int32 - var _ /* nDocsize at bp+156 */ int32 + var _ /* nDoc at bp+164 */ int32 + var _ /* nDocsize at bp+168 */ int32 var _ /* nInst at bp+108 */ int32 - var _ /* nScore at bp+176 */ int32 + var _ /* nLoc at bp+160 */ int32 + var _ /* nLoc at bp+200 */ int32 + var _ /* nScore at bp+188 */ int32 + var _ /* pLoc at bp+152 */ uintptr + var _ /* pLoc at bp+192 */ uintptr var _ /* rc at bp+104 */ int32 var _ /* sFinder at bp+120 */ TFts5SFinder _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aSeen, i, iBestCol, iBestStart, iCol, ii, jj, nBestScore, nCol, nPhrase, nToken, zEllips, zErr, v1, v5 @@ -197017,7 +199443,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35013 + zErr = __ccgo_ts + 35108 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -197050,17 +199476,23 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt break } if iCol < 0 || iCol == i { + *(*uintptr)(unsafe.Pointer(bp + 152)) = uintptr(0) /* Locale of column iCol */ + *(*int32)(unsafe.Pointer(bp + 160)) = 0 (*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FiPos = 0 (*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FnFirst = 0 - *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, i, bp+120+24, bp+152) + *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, i, bp+120+24, bp+164) if *(*int32)(unsafe.Pointer(bp + 104)) != SQLITE_OK { break } - *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize})))(tls, pFts, (*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FzDoc, *(*int32)(unsafe.Pointer(bp + 152)), bp+120, __ccgo_fp(_fts5SentenceFinderCb)) + *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnLocale})))(tls, pFts, i, bp+152, bp+160) if *(*int32)(unsafe.Pointer(bp + 104)) != SQLITE_OK { break } - *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnSize})))(tls, pFts, i, bp+156) + *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize_v2})))(tls, pFts, (*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FzDoc, *(*int32)(unsafe.Pointer(bp + 164)), *(*uintptr)(unsafe.Pointer(bp + 152)), *(*int32)(unsafe.Pointer(bp + 160)), bp+120, __ccgo_fp(_fts5SentenceFinderCb)) + if *(*int32)(unsafe.Pointer(bp + 104)) != SQLITE_OK { + break + } + *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnSize})))(tls, pFts, i, bp+168) if *(*int32)(unsafe.Pointer(bp + 104)) != SQLITE_OK { break } @@ -197069,31 +199501,31 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt if !(*(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK && ii < *(*int32)(unsafe.Pointer(bp + 108))) { break } - *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxInst})))(tls, pFts, ii, bp+160, bp+164, bp+168) - if *(*int32)(unsafe.Pointer(bp + 164)) != i { + *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxInst})))(tls, pFts, ii, bp+172, bp+176, bp+180) + if *(*int32)(unsafe.Pointer(bp + 176)) != i { goto _3 } - if *(*int32)(unsafe.Pointer(bp + 168)) > *(*int32)(unsafe.Pointer(bp + 156)) { + if *(*int32)(unsafe.Pointer(bp + 180)) > *(*int32)(unsafe.Pointer(bp + 168)) { *(*int32)(unsafe.Pointer(bp + 104)) = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } if *(*int32)(unsafe.Pointer(bp + 104)) != SQLITE_OK { goto _3 } libc.Xmemset(tls, aSeen, 0, libc.Uint64FromInt32(nPhrase)) - *(*int32)(unsafe.Pointer(bp + 104)) = _fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 156)), aSeen, i, *(*int32)(unsafe.Pointer(bp + 168)), nToken, bp+176, bp+172) - if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 176)) > nBestScore { - nBestScore = *(*int32)(unsafe.Pointer(bp + 176)) + *(*int32)(unsafe.Pointer(bp + 104)) = _fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 168)), aSeen, i, *(*int32)(unsafe.Pointer(bp + 180)), nToken, bp+188, bp+184) + if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 188)) > nBestScore { + nBestScore = *(*int32)(unsafe.Pointer(bp + 188)) iBestCol = i - iBestStart = *(*int32)(unsafe.Pointer(bp + 172)) - *(*int32)(unsafe.Pointer(bp + 112)) = *(*int32)(unsafe.Pointer(bp + 156)) + iBestStart = *(*int32)(unsafe.Pointer(bp + 184)) + *(*int32)(unsafe.Pointer(bp + 112)) = *(*int32)(unsafe.Pointer(bp + 168)) } - if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK && (*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FnFirst != 0 && *(*int32)(unsafe.Pointer(bp + 156)) > nToken { + if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK && (*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FnFirst != 0 && *(*int32)(unsafe.Pointer(bp + 168)) > nToken { jj = 0 for { if !(jj < (*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FnFirst-int32(1)) { break } - if *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj+int32(1))*4)) > *(*int32)(unsafe.Pointer(bp + 168)) { + if *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj+int32(1))*4)) > *(*int32)(unsafe.Pointer(bp + 180)) { break } goto _4 @@ -197101,20 +199533,20 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt ; jj++ } - if *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj)*4)) < *(*int32)(unsafe.Pointer(bp + 168)) { + if *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj)*4)) < *(*int32)(unsafe.Pointer(bp + 180)) { libc.Xmemset(tls, aSeen, 0, libc.Uint64FromInt32(nPhrase)) - *(*int32)(unsafe.Pointer(bp + 104)) = _fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 156)), aSeen, i, *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj)*4)), nToken, bp+176, uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 104)) = _fts5SnippetScore(tls, pApi, pFts, *(*int32)(unsafe.Pointer(bp + 168)), aSeen, i, *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj)*4)), nToken, bp+188, uintptr(0)) if *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj)*4)) == 0 { v5 = int32(120) } else { v5 = int32(100) } - *(*int32)(unsafe.Pointer(bp + 176)) += v5 - if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 176)) > nBestScore { - nBestScore = *(*int32)(unsafe.Pointer(bp + 176)) + *(*int32)(unsafe.Pointer(bp + 188)) += v5 + if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 188)) > nBestScore { + nBestScore = *(*int32)(unsafe.Pointer(bp + 188)) iBestCol = i iBestStart = *(*int32)(unsafe.Pointer((*(*TFts5SFinder)(unsafe.Pointer(bp + 120))).FaFirst + uintptr(jj)*4)) - *(*int32)(unsafe.Pointer(bp + 112)) = *(*int32)(unsafe.Pointer(bp + 156)) + *(*int32)(unsafe.Pointer(bp + 112)) = *(*int32)(unsafe.Pointer(bp + 168)) } } } @@ -197136,6 +199568,8 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnSize})))(tls, pFts, iBestCol, bp+112) } if (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn != 0 { + *(*uintptr)(unsafe.Pointer(bp + 192)) = uintptr(0) /* Locale of column iBestCol */ + *(*int32)(unsafe.Pointer(bp + 200)) = 0 /* Bytes in pLoc */ if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 104)) = _fts5CInstIterInit(tls, pApi, pFts, iBestCol, bp+40) } @@ -197150,7 +199584,10 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt *(*int32)(unsafe.Pointer(bp + 104)) = _fts5CInstIterNext(tls, bp+40) } if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize})))(tls, pFts, (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn, (*(*THighlightContext)(unsafe.Pointer(bp))).FnIn, bp, __ccgo_fp(_fts5HighlightCb)) + *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnLocale})))(tls, pFts, iBestCol, bp+192, bp+200) + } + if *(*int32)(unsafe.Pointer(bp + 104)) == SQLITE_OK { + *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxTokenize_v2})))(tls, pFts, (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn, (*(*THighlightContext)(unsafe.Pointer(bp))).FnIn, *(*uintptr)(unsafe.Pointer(bp + 192)), *(*int32)(unsafe.Pointer(bp + 200)), bp, __ccgo_fp(_fts5HighlightCb)) } if (*(*THighlightContext)(unsafe.Pointer(bp))).FbOpen != 0 { _fts5HighlightAppend(tls, bp+104, bp, (*(*THighlightContext)(unsafe.Pointer(bp))).FzClose, -int32(1)) @@ -197381,8 +199818,51 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, } } +// C documentation +// +// /* +// ** Implementation of fts5_get_locale() function. +// */ +func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, nVal int32, apVal uintptr) { + bp := tls.Alloc(16) + defer tls.Free(16) + var eType, iCol, rc int32 + var z, z1 uintptr + var _ /* nLocale at bp+8 */ int32 + var _ /* zLocale at bp+0 */ uintptr + _, _, _, _, _ = eType, iCol, rc, z, z1 + iCol = 0 + eType = 0 + rc = SQLITE_OK + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 8)) = 0 + /* xColumnLocale() must be available */ + if nVal != int32(1) { + z = __ccgo_ts + 35156 + Xsqlite3_result_error(tls, pCtx, z, -int32(1)) + return + } + eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) + if eType != int32(SQLITE_INTEGER) { + z1 = __ccgo_ts + 35212 + Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) + return + } + iCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(apVal))) + if iCol < 0 || iCol >= (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnCount})))(tls, pFts) { + Xsqlite3_result_error_code(tls, pCtx, int32(SQLITE_RANGE)) + return + } + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnLocale})))(tls, pFts, iCol, bp, bp+8) + if rc != SQLITE_OK { + Xsqlite3_result_error_code(tls, pCtx, rc) + return + } + Xsqlite3_result_text(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)), uintptr(-libc.Int32FromInt32(1))) +} + func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { - var aBuiltin [3]struct { + var aBuiltin [4]struct { FzFunc uintptr FpUserData uintptr FxFunc Tfts5_extension_function @@ -197390,29 +199870,33 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { } var i, rc int32 _, _, _ = aBuiltin, i, rc - aBuiltin = [3]struct { + aBuiltin = [4]struct { FzFunc uintptr FpUserData uintptr FxFunc Tfts5_extension_function FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35061, + FzFunc: __ccgo_ts + 35270, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35069, + FzFunc: __ccgo_ts + 35278, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35079, + FzFunc: __ccgo_ts + 35288, FxFunc: __ccgo_fp(_fts5Bm25Function), }, + 3: { + FzFunc: __ccgo_ts + 35293, + FxFunc: __ccgo_fp(_fts5GetLocaleFunction), + }, } rc = SQLITE_OK /* To iterate through builtin functions */ i = 0 for { - if !(rc == SQLITE_OK && i < libc.Int32FromUint64(libc.Uint64FromInt64(96)/libc.Uint64FromInt64(32))) { + if !(rc == SQLITE_OK && i < libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(32))) { break } rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, Tfts5_extension_function, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateFunction})))(tls, pApi, aBuiltin[i].FzFunc, aBuiltin[i].FpUserData, aBuiltin[i].FxFunc, aBuiltin[i].FxDestroy) @@ -198065,7 +200549,7 @@ func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { case int32('n'): fallthrough case int32('N'): - if Xsqlite3_strnicmp(tls, __ccgo_ts+1648, p, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+1649, p, int32(4)) == 0 { p = p + 4 } else { p = uintptr(0) @@ -198258,18 +200742,18 @@ func _fts5ConfigSetEnum(tls *libc.TLS, aEnum uintptr, zEnum uintptr, peVal uintp // ** 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) (r int32) { +func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) - var azArg, p, p1, p2, pDel, pSpace uintptr + var azArg, p, p1, p2, pSpace uintptr var bFirst, nByte, nCmd, nPre, v2 int32 var nArg Tsqlite3_int64 var _ /* aDetail at bp+8 */ [4]TFts5Enum var _ /* rc at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pDel, pSpace, v2 + _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35084, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35309, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -198295,12 +200779,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) < int32('0') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35091, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35316, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35122, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35347, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -198309,7 +200793,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35155, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35380, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -198319,15 +200803,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35192, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35417, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(8)*libc.Uint64FromInt64(nArg))) - pDel = _sqlite3Fts5MallocZero(tls, bp, nArg*int64(2)) - pSpace = pDel - if azArg != 0 && pSpace != 0 { - if (*TFts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35201, 0) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + if azArg != 0 { + pSpace = azArg + uintptr(nArg)*8 + if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35426, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -198354,107 +200837,115 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pGlobal uintptr, pConfig uintptr, zC nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35234, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35459, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5GetTokenizer(tls, pGlobal, azArg, int32(nArg), pConfig, pzErr) + (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg + (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnArg = int32(nArg) + azArg = uintptr(0) } } } Xsqlite3_free(tls, azArg) - Xsqlite3_free(tls, pDel) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35268, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35493, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35276, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35501, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*uint8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35308, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35533, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35314, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35539, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35333, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35558, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35376, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35601, zCmd, nCmd) == 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35558, 0) + *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) + } else { + (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) + } + return *(*int32)(unsafe.Pointer(bp)) + } + if Xsqlite3_strnicmp(tls, __ccgo_ts+35623, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35390, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35637, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35428, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35675, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35439, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35686, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5563, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35721, zCmd, nCmd) == 0 { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35728, 0) + *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) + } else { + (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) + } + return *(*int32)(unsafe.Pointer(bp)) + } + if Xsqlite3_strnicmp(tls, __ccgo_ts+5580, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8343, + FzName: __ccgo_ts + 8405, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17834, + FzName: __ccgo_ts + 17899, }, 2: { - FzName: __ccgo_ts + 35474, + FzName: __ccgo_ts + 35759, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, } - v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+96) + v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35482, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35767, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35513, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35798, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35523, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35808, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35557, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35842, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } // C documentation // // /* -// ** 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) (r int32) { - return _sqlite3Fts5GetTokenizer(tls, pGlobal, uintptr(0), 0, pConfig, uintptr(0)) -} - -// C documentation -// -// /* // ** Gobble up the first bareword or quoted word from the input buffer zIn. // ** Return a pointer to the character immediately following the last in // ** the gobbled word if successful, or a NULL pointer otherwise (failed @@ -198502,27 +200993,28 @@ func _fts5ConfigGobbleWord(tls *libc.TLS, pRc uintptr, zIn uintptr, pzOut uintpt return zRet } -func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, pzErr uintptr) (r int32) { +func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr, pzErr uintptr, pbUnindexed uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc, v1 int32 var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35585) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16781) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35590, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35870) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16846) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35875, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35620) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35905) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) + *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35630, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35915, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } } - v2 = p + 24 + v2 = p + 32 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(v1)*8)) = zCol @@ -198543,7 +201035,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35661, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35946, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -198551,9 +201043,13 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35666, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35951, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35673, libc.VaList(bp+32, i)) + if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35958, libc.VaList(bp+32, i)) + } else { + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35966, 0) + } } goto _1 _1: @@ -198561,6 +201057,23 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { i++ } } + if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL && (*TFts5Config)(unsafe.Pointer(p)).FbLocale != 0 { + i = 0 + for { + if !(i < (*TFts5Config)(unsafe.Pointer(p)).FnCol) { + break + } + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35973, libc.VaList(bp+32, i)) + } else { + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35966, 0) + } + goto _2 + _2: + ; + i++ + } + } (*TFts5Config)(unsafe.Pointer(p)).FzContentExprlist = (*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fp return *(*int32)(unsafe.Pointer(bp)) } @@ -198587,18 +201100,21 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in var pRet, z, zOrig, zTail, v1, v2, v4, v5 uintptr var _ /* bDummy at bp+28 */ int32 var _ /* bMustBeCol at bp+24 */ int32 + var _ /* bUnindexed at bp+4 */ int32 var _ /* rc at bp+0 */ int32 var _ /* zOne at bp+8 */ uintptr var _ /* zTwo at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _ = bOption, i, nByte, pRet, z, zOrig, zTail, v1, v2, v4, v5 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - v1 = Xsqlite3_malloc(tls, int32(200)) + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* True if there are one or more UNINDEXED */ + v1 = Xsqlite3_malloc(tls, int32(256)) pRet = v1 *(*uintptr)(unsafe.Pointer(ppOut)) = v1 if pRet == uintptr(0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRet, 0, uint64(200)) + libc.Xmemset(tls, pRet, 0, uint64(256)) + (*TFts5Config)(unsafe.Pointer(pRet)).FpGlobal = pGlobal (*TFts5Config)(unsafe.Pointer(pRet)).Fdb = db (*TFts5Config)(unsafe.Pointer(pRet)).FiCookie = -int32(1) nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nArg) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt64(1))) @@ -198613,8 +201129,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35585) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35681, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35870) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35981, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -198645,23 +201161,23 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35710, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36010, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { v4 = *(*uintptr)(unsafe.Pointer(bp + 8)) } else { - v4 = __ccgo_ts + 1662 + v4 = __ccgo_ts + 1663 } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { v5 = *(*uintptr)(unsafe.Pointer(bp + 16)) } else { - v5 = __ccgo_ts + 1662 + v5 = __ccgo_ts + 1663 } - *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseSpecial(tls, pGlobal, pRet, v4, v5, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseSpecial(tls, pRet, v4, v5, pzErr) } else { - *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseColumn(tls, pRet, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16)), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseColumn(tls, pRet, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 16)), pzErr, bp+4) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) } } @@ -198675,7 +201191,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35730, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36030, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -198683,31 +201199,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35780, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36080, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } - /* If a tokenizer= option was successfully parsed, the tokenizer has - ** already been allocated. Otherwise, allocate an instance of the default - ** tokenizer (unicode61) now. */ - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FpTok == uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigDefaultTokenizer(tls, pGlobal, pRet) + /* We only allow contentless_unindexed=1 if the table is actually a + ** contentless one. + */ + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36135, 0) + *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35268 + zTail = __ccgo_ts + 35493 } else { - if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 35835 + if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { + (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) + zTail = __ccgo_ts + 35493 + } else { + if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { + zTail = __ccgo_ts + 36188 + } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35843, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36196, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16781, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16846, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -198729,9 +201251,14 @@ func _sqlite3Fts5ConfigFree(tls *libc.TLS, pConfig uintptr) { var i int32 _ = i if pConfig != 0 { - if (*TFts5Config)(unsafe.Pointer(pConfig)).FpTok != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FpTokApi)).FxDelete})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).FpTok) + if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok != 0 { + if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxDelete})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok) + } else { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxDelete})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok) + } } + Xsqlite3_free(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg) Xsqlite3_free(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb) Xsqlite3_free(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName) i = 0 @@ -198771,25 +201298,25 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35854, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36207, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } if i == 0 { - v2 = __ccgo_ts + 1662 + v2 = __ccgo_ts + 1663 } else { - v2 = __ccgo_ts + 15083 + v2 = __ccgo_ts + 15145 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35870, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36223, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35877, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35585)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36230, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35870)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -198823,10 +201350,22 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** 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) (r int32) { - if pText == uintptr(0) { - return SQLITE_OK + var rc int32 + _ = rc + rc = SQLITE_OK + if pText != 0 { + if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok == uintptr(0) { + rc = _sqlite3Fts5LoadTokenizer(tls, pConfig) + } + if rc == SQLITE_OK { + if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + } else { + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + } + } } - return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FpTokApi)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).FpTok, pCtx, flags, pText, nText, xToken) + return rc } // C documentation @@ -198929,13 +201468,13 @@ func _sqlite3Fts5ConfigParseRank(tls *libc.TLS, zIn uintptr, pzRank uintptr, pzR func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pVal uintptr, pbBadkey uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var bVal, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, v1 int32 + var bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, v1, v2 int32 var zIn uintptr var _ /* zRank at bp+0 */ uintptr var _ /* zRankArgs at bp+8 */ uintptr - _, _, _, _, _, _, _, _, _, _ = bVal, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1 + _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35903) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36256) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -198946,7 +201485,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35908) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36261) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -198957,7 +201496,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35917) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36270) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -198971,7 +201510,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35927) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36280) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -198982,7 +201521,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35937) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36290) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -198999,7 +201538,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35949) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36302) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -199014,7 +201553,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35585) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35870) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -199029,7 +201568,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35961) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36314) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -199045,7 +201584,24 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - *(*int32)(unsafe.Pointer(pbBadkey)) = int32(1) + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36328) { + bVal1 = -int32(1) + if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { + bVal1 = Xsqlite3_value_int(tls, pVal) + } + if bVal1 < 0 { + *(*int32)(unsafe.Pointer(pbBadkey)) = int32(1) + } else { + if bVal1 != 0 { + v2 = int32(1) + } else { + v2 = 0 + } + (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = v2 + } + } else { + *(*int32)(unsafe.Pointer(pbBadkey)) = int32(1) + } } } } @@ -199071,7 +201627,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 35975 + zSelect = __ccgo_ts + 36338 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -199091,7 +201647,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36007) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36370) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -199102,9 +201658,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg != 0 { - *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+36015, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) - } + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36378, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -199114,6 +201668,28 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in return *(*int32)(unsafe.Pointer(bp + 8)) } +// C documentation +// +// /* +// ** Set (*pConfig->pzErrmsg) to point to an sqlite3_malloc()ed buffer +// ** containing the error message created using printf() style formatting +// ** string zFmt and its trailing arguments. +// */ +func _sqlite3Fts5ConfigErrmsg(tls *libc.TLS, pConfig uintptr, zFmt uintptr, va uintptr) { + var ap Tva_list + var zMsg uintptr + _, _ = ap, zMsg /* ... printf arguments */ + zMsg = uintptr(0) + ap = va + zMsg = Xsqlite3_vmprintf(tls, zFmt, ap) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg != 0 { + *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = zMsg + } else { + Xsqlite3_free(tls, zMsg) + } + _ = ap +} + /* ** 2014 May 31 ** @@ -199160,7 +201736,7 @@ type Fts5Expr1 = TFts5Expr1 /* ** eType: -** Expression node type. Always one of: +** Expression node type. Usually one of: ** ** FTS5_AND (nChild, apChild valid) ** FTS5_OR (nChild, apChild valid) @@ -199168,6 +201744,10 @@ type Fts5Expr1 = TFts5Expr1 ** FTS5_STRING (pNear valid) ** FTS5_TERM (pNear valid) ** +** An expression node with eType==0 may also exist. It always matches zero +** rows. This is created when a phrase containing no tokens is parsed. +** e.g. "". +** ** iHeight: ** Distance from this node to furthest leaf. This is always 0 for nodes ** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one @@ -199324,7 +201904,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36086, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36449, 0) return FTS5_EOF } goto _1 @@ -199335,7 +201915,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36106, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36469, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -199350,13 +201930,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36137, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36500, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36140, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36503, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30881, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30964, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -199376,12 +201956,12 @@ func _fts5ParseFree(tls *libc.TLS, p uintptr) { func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCol int32, zExpr uintptr, ppNew uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) - var n, nByte, t int32 + var n, t int32 var pColset, pEngine, pNew, v1 uintptr var _ /* sParse at bp+0 */ TFts5Parse var _ /* token at bp+48 */ TFts5Token var _ /* z at bp+64 */ uintptr - _, _, _, _, _, _, _ = n, nByte, pColset, pEngine, pNew, t, v1 + _, _, _, _, _, _ = n, pColset, pEngine, pNew, t, v1 *(*uintptr)(unsafe.Pointer(bp + 64)) = zExpr *(*uintptr)(unsafe.Pointer(ppNew)) = uintptr(0) *(*uintptr)(unsafe.Pointer(pzErr)) = uintptr(0) @@ -199399,7 +201979,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo _sqlite3Fts5ParserFree(tls, pEngine, __ccgo_fp(_fts5ParseFree)) /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ - if iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol && (*(*TFts5Parse)(unsafe.Pointer(bp))).FpExpr != 0 && (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK { + if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { n = int32(8) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { @@ -199416,15 +201996,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) _sqlite3Fts5ParseNodeFree(tls, (*(*TFts5Parse)(unsafe.Pointer(bp))).FpExpr) } else { - if !((*(*TFts5Parse)(unsafe.Pointer(bp))).FpExpr != 0) { - nByte = int32(56) - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp+16, int64(nByte)) - if (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot != 0 { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FbEof = int32(1) - } - } else { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = (*(*TFts5Parse)(unsafe.Pointer(bp))).FpExpr - } + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = (*(*TFts5Parse)(unsafe.Pointer(bp))).FpExpr (*TFts5Expr)(unsafe.Pointer(pNew)).FpIndex = uintptr(0) (*TFts5Expr)(unsafe.Pointer(pNew)).FpConfig = pConfig (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = (*(*TFts5Parse)(unsafe.Pointer(bp))).FapPhrase @@ -200505,7 +203077,7 @@ func _fts5ExprNodeTest_STRING(tls *libc.TLS, pExpr uintptr, pNode uintptr) (r in } } else { pIter = (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32 + uintptr(j)*40))).FpIter - if (*TFts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == *(*Ti64)(unsafe.Pointer(bp + 8)) || (*TFts5IndexIter)(unsafe.Pointer(pIter)).FbEof != 0 { + if (*TFts5IndexIter)(unsafe.Pointer(pIter)).FiRowid == *(*Ti64)(unsafe.Pointer(bp + 8)) { goto _2 } bMatch = 0 @@ -201046,9 +203618,6 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr SZALLOC = int32(8) pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { - if pPhrase == uintptr(0) { - return pNear - } if pNear == uintptr(0) { nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) @@ -201335,7 +203904,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp pOrig = uintptr(0) /* The phrase extracted from pExpr */ pNew = uintptr(0) /* Expression to return via *ppNew */ *(*TTokenCtx)(unsafe.Pointer(bp + 8)) = TTokenCtx{} /* Context object for fts5ParseTokenize */ - if iPhrase < 0 || iPhrase >= (*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase { + if !(pExpr != 0) || iPhrase < 0 || iPhrase >= (*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_RANGE) } else { pOrig = *(*uintptr)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(iPhrase)*8)) @@ -201432,8 +204001,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36144, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34925, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36507, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35020, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -201453,7 +204022,7 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if libc.Int32FromUint8(c) < int32('0') || libc.Int32FromUint8(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36149, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36512, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) @@ -201591,7 +204160,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21148, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21233, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -201715,7 +204284,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36178, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36541, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -201744,6 +204313,11 @@ func _fts5ExprAssignXNext(tls *libc.TLS, pNode uintptr) { } } +// C documentation +// +// /* +// ** Add pSub as a child of p. +// */ func _fts5ExprAddChildren(tls *libc.TLS, p uintptr, pSub uintptr) { var ii, nByte, v1, v4 int32 var v2 uintptr @@ -201852,8 +204426,8 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin defer tls.Free(16) var iPhrase, nChild int32 var nByte Tsqlite3_int64 - var pPhrase, pRet, v2 uintptr - _, _, _, _, _, _ = iPhrase, nByte, nChild, pPhrase, pRet, v2 + var pPhrase, pRet, v2, v3 uintptr + _, _, _, _, _, _, _ = iPhrase, nByte, nChild, pPhrase, pRet, v2, v3 pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { nChild = 0 /* Bytes of space to allocate for this node */ @@ -201908,21 +204482,25 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36231 + v2 = __ccgo_ts + 36594 } else { - v2 = __ccgo_ts + 36144 + v2 = __ccgo_ts + 36507 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36238, libc.VaList(bp+8, v2)) - Xsqlite3_free(tls, pRet) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36601, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) + pNear = uintptr(0) } } } else { _fts5ExprAddChildren(tls, pRet, pLeft) _fts5ExprAddChildren(tls, pRet, pRight) + v3 = libc.UintptrFromInt32(0) + pRight = v3 + pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36288, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) - Xsqlite3_free(tls, pRet) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36651, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } } @@ -202187,7 +204765,7 @@ func _fts5ExprPopulatePoslistsCb(tls *libc.TLS, pCtx uintptr, tflags int32, pTok } if ((*TFts5ExprTerm)(unsafe.Pointer(pT)).FnQueryTerm == nQuery || (*TFts5ExprTerm)(unsafe.Pointer(pT)).FnQueryTerm < nQuery && (*TFts5ExprTerm)(unsafe.Pointer(pT)).FbPrefix != 0) && libc.Xmemcmp(tls, (*TFts5ExprTerm)(unsafe.Pointer(pT)).FpTerm, pToken, libc.Uint64FromInt32((*TFts5ExprTerm)(unsafe.Pointer(pT)).FnQueryTerm)) == 0 { rc = _sqlite3Fts5PoslistWriterAppend(tls, *(*uintptr)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FapExprPhrase + uintptr(i)*8))+8, (*TFts5ExprCtx)(unsafe.Pointer(p)).FaPopulator+uintptr(i)*16, (*TFts5ExprCtx)(unsafe.Pointer(p)).FiOff) - if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FbTokendata != 0 && !((*TFts5ExprTerm)(unsafe.Pointer(pT)).FbPrefix != 0) { + if rc == SQLITE_OK && ((*TFts5Config)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FbTokendata != 0 || (*TFts5ExprTerm)(unsafe.Pointer(pT)).FbPrefix != 0) { iCol = int32((*TFts5ExprCtx)(unsafe.Pointer(p)).FiOff >> int32(32)) iTokOff = int32((*TFts5ExprCtx)(unsafe.Pointer(p)).FiOff & int64(0x7FFFFFFF)) rc = _sqlite3Fts5IndexIterWriteTokendata(tls, (*TFts5ExprTerm)(unsafe.Pointer(pT)).FpIter, pToken, nToken, iRowid, iCol, iTokOff) @@ -202266,6 +204844,8 @@ func _fts5ExprCheckPoslists(tls *libc.TLS, pNode uintptr, iRowid Ti64) (r int32) (*TFts5ExprNode)(unsafe.Pointer(pNode)).FiRowid = iRowid (*TFts5ExprNode)(unsafe.Pointer(pNode)).FbEof = 0 switch (*TFts5ExprNode)(unsafe.Pointer(pNode)).FeType { + case 0: + fallthrough case int32(FTS5_TERM): fallthrough case int32(FTS5_STRING): @@ -202384,13 +204964,11 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras return int32(SQLITE_RANGE) } pTerm = pPhrase + 32 + uintptr(iToken)*40 - if libc.Int32FromUint8((*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix) == 0 { - if (*TFts5Config)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FbTokendata != 0 { - rc = _sqlite3Fts5IterToken(tls, (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter, iRowid, iCol, iOff+iToken, ppOut, pnOut) - } else { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpTerm - *(*int32)(unsafe.Pointer(pnOut)) = (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FnFullTerm - } + if (*TFts5Config)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pExpr)).FpConfig)).FbTokendata != 0 || (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FbPrefix != 0 { + rc = _sqlite3Fts5IterToken(tls, (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpIter, (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpTerm, (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FnQueryTerm, iRowid, iCol, iOff+iToken, ppOut, pnOut) + } else { + *(*uintptr)(unsafe.Pointer(ppOut)) = (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FpTerm + *(*int32)(unsafe.Pointer(pnOut)) = (*TFts5ExprTerm)(unsafe.Pointer(pTerm)).FnFullTerm } return rc } @@ -203542,11 +206120,12 @@ type TFts5StructureSegment = struct { type Fts5StructureSegment = TFts5StructureSegment type TFts5TokenDataIter = struct { - FnIter int32 - FnIterAlloc int32 - FnMap int32 FnMapAlloc int32 + FnMap int32 FaMap uintptr + Fterms TFts5Buffer + FnIter int32 + FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr FapIter [1]uintptr @@ -203558,6 +206137,7 @@ type TFts5TokenDataMap = struct { FiRowid Ti64 FiPos Ti64 FiIter int32 + FnByte int32 } type Fts5TokenDataMap = TFts5TokenDataMap @@ -204024,13 +206604,17 @@ func _fts5LeafFirstTermOff(tls *libc.TLS, pLeaf uintptr) (r int32) { // /* // ** Close the read-only blob handle, if it is open. // */ -func _sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { +func _fts5IndexCloseReader(tls *libc.TLS, p uintptr) { var pReader uintptr - _ = pReader + var rc int32 + _, _ = pReader, rc if (*TFts5Index)(unsafe.Pointer(p)).FpReader != 0 { pReader = (*TFts5Index)(unsafe.Pointer(p)).FpReader (*TFts5Index)(unsafe.Pointer(p)).FpReader = uintptr(0) - Xsqlite3_blob_close(tls, pReader) + rc = Xsqlite3_blob_close(tls, pReader) + if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { + (*TFts5Index)(unsafe.Pointer(p)).Frc = rc + } } } @@ -204045,8 +206629,8 @@ func _sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { var aOut, pBlob, pConfig, pRet, v1 uintptr var nAlloc Tsqlite3_int64 - var nByte, rc int32 - _, _, _, _, _, _, _, _ = aOut, nAlloc, nByte, pBlob, pConfig, pRet, rc, v1 + var nByte, rc, szData int32 + _, _, _, _, _, _, _, _, _ = aOut, nAlloc, nByte, pBlob, pConfig, pRet, rc, szData, v1 pRet = uintptr(0) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { rc = SQLITE_OK @@ -204059,7 +206643,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { rc = Xsqlite3_blob_reopen(tls, pBlob, iRowid) (*TFts5Index)(unsafe.Pointer(p)).FpReader = pBlob if rc != SQLITE_OK { - _sqlite3Fts5IndexCloseReader(tls, p) + _fts5IndexCloseReader(tls, p) } if rc == int32(SQLITE_ABORT) { rc = SQLITE_OK @@ -204069,7 +206653,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36341, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36704, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -204082,11 +206666,12 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { if rc == SQLITE_OK { aOut = uintptr(0) /* Read blob data into this buffer */ nByte = Xsqlite3_blob_bytes(tls, (*TFts5Index)(unsafe.Pointer(p)).FpReader) - nAlloc = libc.Int64FromUint64(uint64(16) + libc.Uint64FromInt32(nByte) + uint64(FTS5_DATA_PADDING)) + szData = libc.Int32FromUint64((libc.Uint64FromInt64(16) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + nAlloc = int64(szData + nByte + int32(FTS5_DATA_PADDING)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nAlloc)) if pRet != 0 { (*TFts5Data)(unsafe.Pointer(pRet)).Fnn = nByte - v1 = pRet + 1*16 + v1 = pRet + uintptr(szData) (*TFts5Data)(unsafe.Pointer(pRet)).Fp = v1 aOut = v1 } else { @@ -204136,9 +206721,20 @@ func _fts5LeafRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { } func _fts5IndexPrepareStmt(tls *libc.TLS, p uintptr, ppStmt uintptr, zSql uintptr) (r int32) { + var rc, v1 int32 + _, _ = rc, v1 if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { if zSql != 0 { - (*TFts5Index)(unsafe.Pointer(p)).Frc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).Fdb, zSql, -int32(1), libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_PREPARE_PERSISTENT)|libc.Int32FromInt32(SQLITE_PREPARE_NO_VTAB)), ppStmt, uintptr(0)) + rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).Fdb, zSql, -int32(1), libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_PREPARE_PERSISTENT)|libc.Int32FromInt32(SQLITE_PREPARE_NO_VTAB)), ppStmt, uintptr(0)) + /* If this prepare() call fails with SQLITE_ERROR, then one of the + ** %_idx or %_data tables has been removed or modified. Call this + ** corruption. */ + if rc == int32(SQLITE_ERROR) { + v1 = int32(SQLITE_CORRUPT) + } else { + v1 = rc + } + (*TFts5Index)(unsafe.Pointer(p)).Frc = v1 } else { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -204162,7 +206758,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36347, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36710, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -204191,7 +206787,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36398, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36761, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -204225,7 +206821,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36447, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36810, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -204394,7 +206990,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36487, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36850, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -204585,7 +207181,7 @@ func _fts5IndexDataVersion(tls *libc.TLS, p uintptr) (r Ti64) { iVersion = 0 if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*TFts5Index)(unsafe.Pointer(p)).FpDataVersion == uintptr(0) { - (*TFts5Index)(unsafe.Pointer(p)).Frc = _fts5IndexPrepareStmt(tls, p, p+144, Xsqlite3_mprintf(tls, __ccgo_ts+36492, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb))) + (*TFts5Index)(unsafe.Pointer(p)).Frc = _fts5IndexPrepareStmt(tls, p, p+144, Xsqlite3_mprintf(tls, __ccgo_ts+36855, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return 0 } @@ -204669,7 +207265,7 @@ func _fts5StructureWrite(tls *libc.TLS, p uintptr, pStruct uintptr) { _sqlite3Fts5Put32(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, iCookie) (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = int32(4) if (*TFts5Structure)(unsafe.Pointer(pStruct)).FnOriginCntr > uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36487, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36850, uint64(4)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -205564,13 +208160,14 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui bp := tls.Alloc(48) defer tls.Free(48) var iOff int32 - var _ /* iDelta at bp+0 */ Ti64 + var p1 uintptr + var _ /* iDelta at bp+0 */ Tu64 var _ /* nKeep at bp+8 */ int32 var _ /* nList at bp+36 */ int32 var _ /* nTerm at bp+32 */ int32 var _ /* pList at bp+16 */ uintptr var _ /* zTerm at bp+24 */ uintptr - _ = iOff + _, _ = iOff, p1 iOff = int32((*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset) /* Next entry is on the next page */ for (*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg != 0 && iOff >= (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).FszLeaf { @@ -205584,7 +208181,8 @@ func _fts5SegIterNext_None(tls *libc.TLS, p uintptr, pIter uintptr, pbNewTerm ui if iOff < (*TFts5SegIter)(unsafe.Pointer(pIter)).FiEndofDoclist { iOff += libc.Int32FromUint8(_sqlite3Fts5GetVarint(tls, (*TFts5Data)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpLeaf)).Fp+uintptr(iOff), bp)) (*TFts5SegIter)(unsafe.Pointer(pIter)).FiLeafOffset = int64(iOff) - *(*Ti64)(unsafe.Pointer(pIter + 112)) += *(*Ti64)(unsafe.Pointer(bp)) + p1 = pIter + 112 + *(*Ti64)(unsafe.Pointer(p1)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p1))) + *(*Tu64)(unsafe.Pointer(bp))) } else { if (*TFts5SegIter)(unsafe.Pointer(pIter)).Fflags&int32(FTS5_SEGITER_ONETERM) == 0 { if (*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg != 0 { @@ -206044,7 +208642,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36515, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36878, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -206133,7 +208731,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+36599, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+36962, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -207749,7 +210347,7 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 { v1 = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } z = v1 /* The following was already done in fts5WriteInit(): */ @@ -208104,7 +210702,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+36681, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37044, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -208410,6 +211008,12 @@ func _fts5IndexFindDeleteMerge(tls *libc.TLS, p uintptr, pStruct uintptr) (r int nBest = nPercent } } + /* If pLvl is already the input level to an ongoing merge, look no + ** further for a merge candidate. The caller should be allowed to + ** continue merging from pLvl first. */ + if (*TFts5StructureLevel)(unsafe.Pointer(pLvl)).FnMerge != 0 { + break + } goto _1 _1: ; @@ -208536,6 +211140,16 @@ func _fts5IndexReturn(tls *libc.TLS, p uintptr) (r int32) { return rc } +// C documentation +// +// /* +// ** Close the read-only blob handle, if it is open. +// */ +func _sqlite3Fts5IndexCloseReader(tls *libc.TLS, p uintptr) { + _fts5IndexCloseReader(tls, p) + _fts5IndexReturn(tls, p) +} + type TFts5FlushCtx = struct { FpIdx uintptr Fwriter TFts5SegWriter @@ -208594,7 +211208,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+36738, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37101, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -209062,17 +211676,36 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { // ** This is called as part of flushing a delete to disk in 'secure-delete' // ** mode. It edits the segments within the database described by argument // ** pStruct to remove the entries for term zTerm, rowid iRowid. +// ** +// ** Return SQLITE_OK if successful, or an SQLite error code if an error +// ** has occurred. Any error code is also stored in the Fts5Index handle. // */ -func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uintptr, nTerm int32, iRowid Ti64) { - bp := tls.Alloc(16) - defer tls.Free(16) - var f int32 +func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uintptr, nTerm int32, iRowid Ti64) (r int32) { + bp := tls.Alloc(48) + defer tls.Free(48) + var f, rc int32 var iThis Ti64 - var pSeg uintptr + var pConfig, pSeg uintptr var _ /* pIter at bp+0 */ uintptr - _, _, _ = f, iThis, pSeg + var _ /* pStmt at bp+8 */ uintptr + _, _, _, _, _ = f, iThis, pConfig, pSeg, rc f = int32(FTS5INDEX_QUERY_SKIPHASH) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Used to find term instance */ + /* If the version number has not been set to SECUREDELETE, do so now. */ + if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { + pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig + *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37162, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { + Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) + rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) + if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { + (*TFts5Index)(unsafe.Pointer(p)).Frc = rc + } + (*TFts5Config)(unsafe.Pointer(pConfig)).FiCookie++ + (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = int32(FTS5_CURRENT_VERSION_SECUREDELETE) + } + } _fts5MultiIterNew(tls, p, pStruct, f, uintptr(0), zTerm, nTerm, -int32(1), 0, bp) if _fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp))) == 0 { iThis = _fts5MultiIterRowid(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -209085,6 +211718,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin } } _fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp))) + return (*TFts5Index)(unsafe.Pointer(p)).Frc } // C documentation @@ -209166,8 +211800,7 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { ** using fts5FlushSecureDelete(). */ if bSecureDelete != 0 { if eDetail == int32(FTS5_DETAIL_NONE) { - if iOff < *(*int32)(unsafe.Pointer(bp + 160)) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 152)) + uintptr(iOff)))) == 0x00 { - _fts5FlushSecureDelete(tls, p, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 136)), *(*int32)(unsafe.Pointer(bp + 144)), iRowid) + if iOff < *(*int32)(unsafe.Pointer(bp + 160)) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 152)) + uintptr(iOff)))) == 0x00 && !(_fts5FlushSecureDelete(tls, p, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 136)), *(*int32)(unsafe.Pointer(bp + 144)), iRowid) != 0) { iOff++ if iOff < *(*int32)(unsafe.Pointer(bp + 160)) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 152)) + uintptr(iOff)))) == 0x00 { iOff++ @@ -209177,8 +211810,7 @@ func _fts5FlushOneHash(tls *libc.TLS, p uintptr) { } } } else { - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 152)) + uintptr(iOff))))&int32(0x01) != 0 { - _fts5FlushSecureDelete(tls, p, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 136)), *(*int32)(unsafe.Pointer(bp + 144)), iRowid) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 152)) + uintptr(iOff))))&int32(0x01) != 0 && !(_fts5FlushSecureDelete(tls, p, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 136)), *(*int32)(unsafe.Pointer(bp + 144)), iRowid) != 0) { if (*TFts5Index)(unsafe.Pointer(p)).Frc != SQLITE_OK || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 152)) + uintptr(iOff)))) == int32(0x01) { iOff++ continue @@ -209848,173 +212480,532 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu *(*TFts5Buffer)(unsafe.Pointer(p1)) = *(*TFts5Buffer)(unsafe.Pointer(bp + 1032)) } -func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pToken uintptr, nToken int32, pColset uintptr, ppIter uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var aBuf, pData, pSeg, pSeg1, pStruct, pTerm, xAppend, xMerge uintptr - var f2, flags, i, i1, iFree, iStore, nBuf, nMerge, nTerm, v8 int32 - var iLastRowid Ti64 - var _ /* bNewTerm at bp+24 */ int32 - var _ /* doclist at bp+8 */ TFts5Buffer - var _ /* dummy at bp+28 */ int32 +// C documentation +// +// /* +// ** Iterate through a range of entries in the FTS index, invoking the xVisit +// ** callback for each of them. +// ** +// ** Parameter pToken points to an nToken buffer containing an FTS index term +// ** (i.e. a document term with the preceding 1 byte index identifier - +// ** FTS5_MAIN_PREFIX or similar). If bPrefix is true, then the call visits +// ** all entries for terms that have pToken/nToken as a prefix. If bPrefix +// ** is false, then only entries with pToken/nToken as the entire key are +// ** visited. +// ** +// ** If the current table is a tokendata=1 table, then if bPrefix is true then +// ** each index term is treated separately. However, if bPrefix is false, then +// ** all index terms corresponding to pToken/nToken are collapsed into a single +// ** term before the callback is invoked. +// ** +// ** The callback invoked for each entry visited is specified by paramter xVisit. +// ** Each time it is invoked, it is passed a pointer to the Fts5Index object, +// ** a copy of the 7th paramter to this function (pCtx) and a pointer to the +// ** iterator that indicates the current entry. If the current entry is the +// ** first with a new term (i.e. different from that of the previous entry, +// ** including the very first term), then the final two parameters are passed +// ** a pointer to the term and its size in bytes, respectively. If the current +// ** entry is not the first associated with its term, these two parameters +// ** are passed 0. +// ** +// ** If parameter pColset is not NULL, then it is used to filter entries before +// ** the callback is invoked. +// */ +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var flags, nNew, v1 int32 + var pNew, pSeg, pStruct uintptr + var _ /* bNewTerm at bp+8 */ int32 var _ /* p1 at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aBuf, f2, flags, i, i1, iFree, iLastRowid, iStore, nBuf, nMerge, nTerm, pData, pSeg, pSeg1, pStruct, pTerm, xAppend, xMerge, v8 - nBuf = int32(32) - nMerge = int32(1) - if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - xMerge = __ccgo_fp(_fts5MergeRowidLists) - xAppend = __ccgo_fp(_fts5AppendRowid) + _, _, _, _, _, _ = flags, nNew, pNew, pSeg, pStruct, v1 + if bPrefix != 0 { + v1 = int32(FTS5INDEX_QUERY_SCAN) } else { - nMerge = libc.Int32FromInt32(FTS5_MERGE_NLIST) - libc.Int32FromInt32(1) - nBuf = nMerge * int32(8) /* Sufficient to merge (16^8)==(2^32) lists */ - xMerge = __ccgo_fp(_fts5MergePrefixLists) - xAppend = __ccgo_fp(_fts5AppendPoslist) + v1 = 0 } - aBuf = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)*libc.Uint64FromInt32(nBuf))) + flags = v1 | int32(FTS5INDEX_QUERY_SKIPEMPTY) | int32(FTS5INDEX_QUERY_NOOUTPUT) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator used to gather data from index */ + *(*int32)(unsafe.Pointer(bp + 8)) = int32(1) pStruct = _fts5StructureRead(tls, p) + _fts5MultiIterNew(tls, p, pStruct, flags, pColset, pToken, nToken, -int32(1), 0, bp) + _fts5IterSetOutputCb(tls, p+60, *(*uintptr)(unsafe.Pointer(bp))) + for { + if !(_fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp))) == 0) { + break + } + pSeg = *(*uintptr)(unsafe.Pointer(bp)) + 104 + uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaFirst + 1*4))).FiFirst)*128 + nNew = 0 + pNew = uintptr(0) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxSetOutputs})))(tls, *(*uintptr)(unsafe.Pointer(bp)), pSeg) + if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { + break + } + if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { + nNew = (*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fn + pNew = (*TFts5SegIter)(unsafe.Pointer(pSeg)).Fterm.Fp + if nNew < nToken || libc.Xmemcmp(tls, pToken, pNew, libc.Uint64FromInt32(nToken)) != 0 { + break + } + } + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + goto _2 + _2: + ; + _fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp)), bp+8) + } + _fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp))) + _fts5StructureRelease(tls, pStruct) + return (*TFts5Index)(unsafe.Pointer(p)).Frc +} + +/* +** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an +** array of these for each row it visits (so all iRowid fields are the same). +** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an +** array of these for the entire query (in which case iRowid fields may take +** a variety of values). +** +** Each instance in the array indicates the iterator (and therefore term) +** associated with position iPos of rowid iRowid. This is used by the +** xInstToken() API. +** +** iRowid: +** Rowid for the current entry. +** +** iPos: +** Position of current entry within row. In the usual ((iCol<<32)+iOff) +** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). +** +** iIter: +** If the Fts5TokenDataIter iterator that the entry is part of is +** actually an iterator (i.e. with nIter>0, not just a container for +** Fts5TokenDataMap structures), then this variable is an index into +** the apIter[] array. The corresponding term is that which the iterator +** at apIter[iIter] currently points to. +** +** Or, if the Fts5TokenDataIter iterator is just a container object +** (nIter==0), then iIter is an index into the term.p[] buffer where +** the term is stored. +** +** nByte: +** In the case where iIter is an index into term.p[], this variable +** is the size of the term in bytes. If iIter is an index into apIter[], +** this variable is unused. + */ +type TFts5TokenDataMap1 = struct { + FiRowid Ti64 + FiPos Ti64 + FiIter int32 + FnByte int32 +} + +type Fts5TokenDataMap1 = TFts5TokenDataMap1 + +/* +** An object used to supplement Fts5Iter for tokendata=1 iterators. +** +** This object serves two purposes. The first is as a container for an array +** of Fts5TokenDataMap structures, which are used to find the token required +** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and +** aMap[] variables. + */ +type TFts5TokenDataIter1 = struct { + FnMapAlloc int32 + FnMap int32 + FaMap uintptr + Fterms TFts5Buffer + FnIter int32 + FnIterAlloc int32 + FaPoslistReader uintptr + FaPoslistToIter uintptr + FapIter [1]uintptr +} + +type Fts5TokenDataIter1 = TFts5TokenDataIter1 + +// C documentation +// +// /* +// ** The two input arrays - a1[] and a2[] - are in sorted order. This function +// ** merges the two arrays together and writes the result to output array +// ** aOut[]. aOut[] is guaranteed to be large enough to hold the result. +// ** +// ** Duplicate entries are copied into the output. So the size of the output +// ** array is always (n1+n2) entries. +// */ +func _fts5TokendataMerge(tls *libc.TLS, a1 uintptr, n1 int32, a2 uintptr, n2 int32, aOut uintptr) { + var i1, i2 int32 + var pOut uintptr + _, _, _ = i1, i2, pOut + i1 = 0 + i2 = 0 + for i1 < n1 || i2 < n2 { + pOut = aOut + uintptr(i1+i2)*24 + if i2 >= n2 || i1 < n1 && ((*(*TFts5TokenDataMap)(unsafe.Pointer(a1 + uintptr(i1)*24))).FiRowid < (*(*TFts5TokenDataMap)(unsafe.Pointer(a2 + uintptr(i2)*24))).FiRowid || (*(*TFts5TokenDataMap)(unsafe.Pointer(a1 + uintptr(i1)*24))).FiRowid == (*(*TFts5TokenDataMap)(unsafe.Pointer(a2 + uintptr(i2)*24))).FiRowid && (*(*TFts5TokenDataMap)(unsafe.Pointer(a1 + uintptr(i1)*24))).FiPos <= (*(*TFts5TokenDataMap)(unsafe.Pointer(a2 + uintptr(i2)*24))).FiPos) { + libc.Xmemcpy(tls, pOut, a1+uintptr(i1)*24, uint64(24)) + i1++ + } else { + libc.Xmemcpy(tls, pOut, a2+uintptr(i2)*24, uint64(24)) + i2++ + } + } +} + +// C documentation +// +// /* +// ** Append a mapping to the token-map belonging to object pT. +// */ +func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int32, nByte int32, iRowid Ti64, iPos Ti64) { + var aNew uintptr + var nAlloc, nNew, v1 int32 + _, _, _, _ = aNew, nAlloc, nNew, v1 if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { - flags = libc.Int32FromInt32(FTS5INDEX_QUERY_SCAN) | libc.Int32FromInt32(FTS5INDEX_QUERY_SKIPEMPTY) | libc.Int32FromInt32(FTS5INDEX_QUERY_NOOUTPUT) - iLastRowid = 0 - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - *(*int32)(unsafe.Pointer(bp + 24)) = int32(1) - libc.Xmemset(tls, bp+8, 0, uint64(16)) - /* If iIdx is non-zero, then it is the number of a prefix-index for - ** prefixes 1 character longer than the prefix being queried for. That - ** index contains all the doclists required, except for the one - ** corresponding to the prefix itself. That one is extracted from the - ** main term index here. */ - if iIdx != 0 { - *(*int32)(unsafe.Pointer(bp + 28)) = 0 - f2 = libc.Int32FromInt32(FTS5INDEX_QUERY_SKIPEMPTY) | libc.Int32FromInt32(FTS5INDEX_QUERY_NOOUTPUT) - *(*Tu8)(unsafe.Pointer(pToken)) = uint8('0') - _fts5MultiIterNew(tls, p, pStruct, f2, pColset, pToken, nToken, -int32(1), 0, bp) - _fts5IterSetOutputCb(tls, p+60, *(*uintptr)(unsafe.Pointer(bp))) + if (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap == (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc { + if (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc != 0 { + v1 = (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc * int32(2) + } else { + v1 = int32(64) + } + nNew = v1 + nAlloc = libc.Int32FromUint64(libc.Uint64FromInt32(nNew) * uint64(24)) + aNew = Xsqlite3_realloc(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap, nAlloc) + if aNew == uintptr(0) { + (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) + return + } + (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap = aNew + (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc = nNew + } + (*(*TFts5TokenDataMap)(unsafe.Pointer((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap + uintptr((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap)*24))).FiRowid = iRowid + (*(*TFts5TokenDataMap)(unsafe.Pointer((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap + uintptr((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap)*24))).FiPos = iPos + (*(*TFts5TokenDataMap)(unsafe.Pointer((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap + uintptr((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap)*24))).FiIter = iIter + (*(*TFts5TokenDataMap)(unsafe.Pointer((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap + uintptr((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap)*24))).FnByte = nByte + (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap++ + } +} + +// C documentation +// +// /* +// ** Sort the contents of the pT->aMap[] array. +// ** +// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** is left in Fts5Index.rc before returning. +// */ +func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { + var a1, a2, aTmp, tmp uintptr + var i1, n1, n2, nByte int32 + var nHalf Ti64 + var v3, v4 int64 + _, _, _, _, _, _, _, _, _, _, _ = a1, a2, aTmp, i1, n1, n2, nByte, nHalf, tmp, v3, v4 + aTmp = uintptr(0) + nByte = libc.Int32FromUint64(libc.Uint64FromInt32((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap) * uint64(24)) + aTmp = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + if aTmp != 0 { + a1 = (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap + a2 = aTmp + nHalf = int64(1) + for { + if !(nHalf < int64((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap)) { + break + } + i1 = 0 for { - if !(_fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp))) == 0) { + if !(i1 < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap) { break } - pSeg = *(*uintptr)(unsafe.Pointer(bp)) + 104 + uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaFirst + 1*4))).FiFirst)*128 - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxSetOutputs})))(tls, *(*uintptr)(unsafe.Pointer(bp)), pSeg) - if (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FnData != 0 { - (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xAppend})))(tls, p, libc.Uint64FromInt64((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid)-libc.Uint64FromInt64(iLastRowid), *(*uintptr)(unsafe.Pointer(bp)), bp+8) - iLastRowid = (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid + if nHalf < int64((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap-i1) { + v3 = nHalf + } else { + v3 = int64((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap - i1) } - goto _1 - _1: + n1 = int32(v3) + if nHalf < int64((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap-i1-n1) { + v4 = nHalf + } else { + v4 = int64((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap - i1 - n1) + } + n2 = int32(v4) + _fts5TokendataMerge(tls, a1+uintptr(i1)*24, n1, a1+uintptr(i1+n1)*24, n2, a2+uintptr(i1)*24) + goto _2 + _2: ; - _fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp)), bp+28) + i1 = int32(int64(i1) + nHalf*libc.Int64FromInt32(2)) } - _fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp))) + tmp = a1 + a1 = a2 + a2 = tmp + goto _1 + _1: + ; + nHalf = nHalf * int64(2) } - *(*Tu8)(unsafe.Pointer(pToken)) = libc.Uint8FromInt32(int32('0') + iIdx) - _fts5MultiIterNew(tls, p, pStruct, flags, pColset, pToken, nToken, -int32(1), 0, bp) - _fts5IterSetOutputCb(tls, p+60, *(*uintptr)(unsafe.Pointer(bp))) + if a1 != (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap { + libc.Xmemcpy(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap, a1, libc.Uint64FromInt32((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap)*uint64(24)) + } + Xsqlite3_free(tls, aTmp) + } +} + +// C documentation +// +// /* +// ** Delete an Fts5TokenDataIter structure and its contents. +// */ +func _fts5TokendataIterDelete(tls *libc.TLS, pSet uintptr) { + var ii int32 + _ = ii + if pSet != 0 { + ii = 0 for { - if !(_fts5MultiIterEof(tls, p, *(*uintptr)(unsafe.Pointer(bp))) == 0) { + if !(ii < (*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FnIter) { break } - pSeg1 = *(*uintptr)(unsafe.Pointer(bp)) + 104 + uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaFirst + 1*4))).FiFirst)*128 - nTerm = (*TFts5SegIter)(unsafe.Pointer(pSeg1)).Fterm.Fn - pTerm = (*TFts5SegIter)(unsafe.Pointer(pSeg1)).Fterm.Fp - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxSetOutputs})))(tls, *(*uintptr)(unsafe.Pointer(bp)), pSeg1) - if *(*int32)(unsafe.Pointer(bp + 24)) != 0 { - if nTerm < nToken || libc.Xmemcmp(tls, pToken, pTerm, libc.Uint64FromInt32(nToken)) != 0 { + _fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(pSet + 56 + uintptr(ii)*8))) + goto _1 + _1: + ; + ii++ + } + _sqlite3Fts5BufferFree(tls, pSet+16) + Xsqlite3_free(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FaPoslistReader) + Xsqlite3_free(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FaMap) + Xsqlite3_free(tls, pSet) + } +} + +// C documentation +// +// /* +// ** fts5VisitEntries() context object used by fts5SetupPrefixIterTokendata() +// ** to pass data to prefixIterSetupTokendataCb(). +// */ +type TTokendataSetupCtx = struct { + FpT uintptr + FiTermOff int32 + FnTermByte int32 +} + +type TokendataSetupCtx = TTokendataSetupCtx + +type TTokendataSetupCtx1 = struct { + FpT uintptr + FiTermOff int32 + FnTermByte int32 +} + +type TokendataSetupCtx1 = TTokendataSetupCtx1 + +// C documentation +// +// /* +// ** fts5VisitEntries() callback used by fts5SetupPrefixIterTokendata(). This +// ** callback adds an entry to the Fts5TokenDataIter.aMap[] array for each +// ** position in the current position-list. It doesn't matter that some of +// ** these may be out of order - they will be sorted later. +// */ +func _prefixIterSetupTokendataCb(tls *libc.TLS, p uintptr, pCtx uintptr, p1 uintptr, pNew uintptr, nNew int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var pSetup uintptr + var _ /* iPos at bp+8 */ Ti64 + var _ /* iPosOff at bp+0 */ int32 + _ = pSetup + pSetup = pCtx + *(*int32)(unsafe.Pointer(bp)) = 0 + *(*Ti64)(unsafe.Pointer(bp + 8)) = 0 + if pNew != 0 { + (*TTokendataSetupCtx)(unsafe.Pointer(pSetup)).FnTermByte = nNew - int32(1) + (*TTokendataSetupCtx)(unsafe.Pointer(pSetup)).FiTermOff = (*TFts5TokenDataIter)(unsafe.Pointer((*TTokendataSetupCtx)(unsafe.Pointer(pSetup)).FpT)).Fterms.Fn + _sqlite3Fts5BufferAppendBlob(tls, p+60, (*TTokendataSetupCtx)(unsafe.Pointer(pSetup)).FpT+16, libc.Uint32FromInt32(nNew-int32(1)), pNew+uintptr(1)) + } + for 0 == _sqlite3Fts5PoslistNext64(tls, (*TFts5Iter)(unsafe.Pointer(p1)).Fbase.FpData, (*TFts5Iter)(unsafe.Pointer(p1)).Fbase.FnData, bp, bp+8) { + _fts5TokendataIterAppendMap(tls, p, (*TTokendataSetupCtx)(unsafe.Pointer(pSetup)).FpT, (*TTokendataSetupCtx)(unsafe.Pointer(pSetup)).FiTermOff, (*TTokendataSetupCtx)(unsafe.Pointer(pSetup)).FnTermByte, (*TFts5Iter)(unsafe.Pointer(p1)).Fbase.FiRowid, *(*Ti64)(unsafe.Pointer(bp + 8))) + } +} + +// C documentation +// +// /* +// ** Context object passed by fts5SetupPrefixIter() to fts5VisitEntries(). +// */ +type TPrefixSetupCtx = struct { + FxMerge uintptr + FxAppend uintptr + FiLastRowid Ti64 + FnMerge int32 + FaBuf uintptr + FnBuf int32 + Fdoclist TFts5Buffer + FpTokendata uintptr +} + +type PrefixSetupCtx = TPrefixSetupCtx + +type TPrefixSetupCtx1 = struct { + FxMerge uintptr + FxAppend uintptr + FiLastRowid Ti64 + FnMerge int32 + FaBuf uintptr + FnBuf int32 + Fdoclist TFts5Buffer + FpTokendata uintptr +} + +type PrefixSetupCtx1 = TPrefixSetupCtx1 + +// C documentation +// +// /* +// ** fts5VisitEntries() callback used by fts5SetupPrefixIter() +// */ +func _prefixIterSetupCb(tls *libc.TLS, p uintptr, pCtx uintptr, p1 uintptr, pNew uintptr, nNew int32) { + var i, i1, iStore, nMerge int32 + var pSetup uintptr + _, _, _, _, _ = i, i1, iStore, nMerge, pSetup + pSetup = pCtx + nMerge = (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FnMerge + if (*TFts5Iter)(unsafe.Pointer(p1)).Fbase.FnData > 0 { + if (*TFts5Iter)(unsafe.Pointer(p1)).Fbase.FiRowid <= (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FiLastRowid && (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).Fdoclist.Fn > 0 { + i = 0 + for { + if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).Fdoclist.Fn != 0) { break } - } - if (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FnData == 0 { - goto _2 - } - if (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid <= iLastRowid && (*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fn > 0 { - i = 0 + i1 = i * nMerge + iStore = i1 for { - if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fn != 0) { + if !(iStore < i1+nMerge) { break } - i1 = i * nMerge + if (*(*TFts5Buffer)(unsafe.Pointer((*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FaBuf + uintptr(iStore)*16))).Fn == 0 { + _fts5BufferSwap(tls, pSetup+48, (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FaBuf+uintptr(iStore)*16) + _sqlite3Fts5BufferZero(tls, pSetup+48) + break + } + goto _2 + _2: + ; + iStore++ + } + if iStore == i1+nMerge { + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FxMerge})))(tls, p, pSetup+48, nMerge, (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FaBuf+uintptr(i1)*16) iStore = i1 for { if !(iStore < i1+nMerge) { break } - if (*(*TFts5Buffer)(unsafe.Pointer(aBuf + uintptr(iStore)*16))).Fn == 0 { - _fts5BufferSwap(tls, bp+8, aBuf+uintptr(iStore)*16) - _sqlite3Fts5BufferZero(tls, bp+8) - break - } - goto _4 - _4: + _sqlite3Fts5BufferZero(tls, (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FaBuf+uintptr(iStore)*16) + goto _3 + _3: ; iStore++ } - if iStore == i1+nMerge { - (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{xMerge})))(tls, p, bp+8, nMerge, aBuf+uintptr(i1)*16) - iStore = i1 - for { - if !(iStore < i1+nMerge) { - break - } - _sqlite3Fts5BufferZero(tls, aBuf+uintptr(iStore)*16) - goto _5 - _5: - ; - iStore++ - } - } - goto _3 - _3: - ; - i++ } - iLastRowid = 0 + goto _1 + _1: + ; + i++ } - (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xAppend})))(tls, p, libc.Uint64FromInt64((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid)-libc.Uint64FromInt64(iLastRowid), *(*uintptr)(unsafe.Pointer(bp)), bp+8) - iLastRowid = (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fbase.FiRowid - goto _2 - _2: - ; - _fts5MultiIterNext2(tls, p, *(*uintptr)(unsafe.Pointer(bp)), bp+24) + (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FiLastRowid = 0 } + (*(*func(*libc.TLS, uintptr, Tu64, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FxAppend})))(tls, p, libc.Uint64FromInt64((*TFts5Iter)(unsafe.Pointer(p1)).Fbase.FiRowid)-libc.Uint64FromInt64((*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FiLastRowid), p1, pSetup+48) + (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FiLastRowid = (*TFts5Iter)(unsafe.Pointer(p1)).Fbase.FiRowid + } + if (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FpTokendata != 0 { + _prefixIterSetupTokendataCb(tls, p, (*TPrefixSetupCtx)(unsafe.Pointer(pSetup)).FpTokendata, p1, pNew, nNew) + } +} + +func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pToken uintptr, nToken int32, pColset uintptr, ppIter uintptr) { + bp := tls.Alloc(96) + defer tls.Free(96) + var i, iFree, v3 int32 + var pCtx, pData, pStruct uintptr + var _ /* s at bp+0 */ TPrefixSetupCtx + var _ /* s2 at bp+72 */ TTokendataSetupCtx + _, _, _, _, _, _ = i, iFree, pCtx, pData, pStruct, v3 + libc.Xmemset(tls, bp, 0, uint64(72)) + libc.Xmemset(tls, bp+72, 0, uint64(16)) + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge = int32(1) + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FiLastRowid = 0 + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) + if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + } + if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxAppend = __ccgo_fp(_fts5AppendRowid) + } else { + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge = libc.Int32FromInt32(FTS5_MERGE_NLIST) - libc.Int32FromInt32(1) + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge * int32(8) /* Sufficient to merge (16^8)==(2^32) lists */ + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergePrefixLists) + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxAppend = __ccgo_fp(_fts5AppendPoslist) + } + (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FaBuf = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)*libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf))) + pStruct = _fts5StructureRead(tls, p) + if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { + pCtx = bp + /* If iIdx is non-zero, then it is the number of a prefix-index for + ** prefixes 1 character longer than the prefix being queried for. That + ** index contains all the doclists required, except for the one + ** corresponding to the prefix itself. That one is extracted from the + ** main term index here. */ + if iIdx != 0 { + *(*Tu8)(unsafe.Pointer(pToken)) = uint8('0') + _fts5VisitEntries(tls, p, pColset, pToken, nToken, 0, __ccgo_fp(_prefixIterSetupCb), pCtx) + } + *(*Tu8)(unsafe.Pointer(pToken)) = libc.Uint8FromInt32(int32('0') + iIdx) + _fts5VisitEntries(tls, p, pColset, pToken, nToken, int32(1), __ccgo_fp(_prefixIterSetupCb), pCtx) i = 0 for { - if !(i < nBuf) { + if !(i < (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf) { break } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{xMerge})))(tls, p, bp+8, nMerge, aBuf+uintptr(i)*16) + (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge})))(tls, p, bp+48, (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge, (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FaBuf+uintptr(i)*16) } iFree = i for { - if !(iFree < i+nMerge) { + if !(iFree < i+(*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge) { break } - _sqlite3Fts5BufferFree(tls, aBuf+uintptr(iFree)*16) - goto _7 - _7: + _sqlite3Fts5BufferFree(tls, (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FaBuf+uintptr(iFree)*16) + goto _2 + _2: ; iFree++ } - goto _6 - _6: + goto _1 + _1: ; - i += nMerge + i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - _fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(bp))) - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 - v8 = (*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fn - (*TFts5Data)(unsafe.Pointer(pData)).FszLeaf = v8 - (*TFts5Data)(unsafe.Pointer(pData)).Fnn = v8 - if (*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fn != 0 { - libc.Xmemcpy(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fp, libc.Uint64FromInt32((*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fn)) + v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn + (*TFts5Data)(unsafe.Pointer(pData)).FszLeaf = v3 + (*TFts5Data)(unsafe.Pointer(pData)).Fnn = v3 + if (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn != 0 { + libc.Xmemcpy(tls, (*TFts5Data)(unsafe.Pointer(pData)).Fp, (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fp, libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)) } _fts5MultiIterNew2(tls, p, pData, bDesc, ppIter) } - _sqlite3Fts5BufferFree(tls, bp+8) + if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata != 0 { + _fts5TokendataIterSortMap(tls, p, (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT) + (*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppIter)))).FpTokenDataIter = (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = uintptr(0) + } } + _fts5TokendataIterDelete(tls, (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT) + _sqlite3Fts5BufferFree(tls, bp+48) _fts5StructureRelease(tls, pStruct) - Xsqlite3_free(tls, aBuf) + Xsqlite3_free(tls, (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FaBuf) } // C documentation @@ -210047,7 +213038,7 @@ func _sqlite3Fts5IndexBeginWrite(tls *libc.TLS, p uintptr, bDelete int32, iRowid // */ func _sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) (r int32) { _fts5IndexFlush(tls, p) - _sqlite3Fts5IndexCloseReader(tls, p) + _fts5IndexCloseReader(tls, p) return _fts5IndexReturn(tls, p) } @@ -210060,11 +213051,10 @@ func _sqlite3Fts5IndexSync(tls *libc.TLS, p uintptr) (r int32) { // ** records must be invalidated. // */ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { - _sqlite3Fts5IndexCloseReader(tls, p) + _fts5IndexCloseReader(tls, p) _fts5IndexDiscardData(tls, p) _fts5StructureInvalidate(tls, p) - /* assert( p->rc==SQLITE_OK ); */ - return SQLITE_OK + return _fts5IndexReturn(tls, p) } // C documentation @@ -210084,7 +213074,7 @@ func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) } - _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1662, 0) + _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1663, 0) _fts5StructureWrite(tls, p, bp) return _fts5IndexReturn(tls, p) } @@ -210111,11 +213101,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36799, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37213, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+25916, __ccgo_ts+36807, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+25999, __ccgo_ts+37221, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11918, __ccgo_ts+36842, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11980, __ccgo_ts+37256, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -210282,40 +213272,18 @@ func _fts5SegIterSetEOF(tls *libc.TLS, pSeg uintptr) { (*TFts5SegIter)(unsafe.Pointer(pSeg)).FpLeaf = uintptr(0) } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits. Or, for an iterator used by an -** "ORDER BY rank" query, it accumulates an array of these for the entire -** query. -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. - */ -type TFts5TokenDataIter1 = struct { - FnIter int32 - FnIterAlloc int32 - FnMap int32 - FnMapAlloc int32 - FaMap uintptr - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr +func _fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { + var pIndex, pIter uintptr + _, _ = pIndex, pIter + if pIndexIter != 0 { + pIter = pIndexIter + pIndex = (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex + _fts5TokendataIterDelete(tls, (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter) + _fts5MultiIterFree(tls, pIter) + _fts5IndexCloseReader(tls, pIndex) + } } -type Fts5TokenDataIter1 = TFts5TokenDataIter1 - // C documentation // // /* @@ -210335,7 +213303,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(48)) + nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -210349,12 +213317,12 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin } } if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { - _sqlite3Fts5IterClose(tls, pAppend) + _fts5IterClose(tls, pAppend) } else { - v3 = pRet + v3 = pRet + 32 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ - *(*uintptr)(unsafe.Pointer(pRet + 40 + uintptr(v2)*8)) = pAppend + *(*uintptr)(unsafe.Pointer(pRet + 56 + uintptr(v2)*8)) = pAppend } return pRet } @@ -210362,65 +213330,6 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin // C documentation // // /* -// ** Delete an Fts5TokenDataIter structure and its contents. -// */ -func _fts5TokendataIterDelete(tls *libc.TLS, pSet uintptr) { - var ii int32 - _ = ii - if pSet != 0 { - ii = 0 - for { - if !(ii < (*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FnIter) { - break - } - _fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(pSet + 40 + uintptr(ii)*8))) - goto _1 - _1: - ; - ii++ - } - Xsqlite3_free(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FaPoslistReader) - Xsqlite3_free(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FaMap) - Xsqlite3_free(tls, pSet) - } -} - -// C documentation -// -// /* -// ** Append a mapping to the token-map belonging to object pT. -// */ -func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int32, iRowid Ti64, iPos Ti64) { - var aNew uintptr - var nByte, nNew, v1 int32 - _, _, _, _ = aNew, nByte, nNew, v1 - if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { - if (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap == (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc { - if (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc != 0 { - v1 = (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc * int32(2) - } else { - v1 = int32(64) - } - nNew = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nNew) * uint64(24)) - aNew = Xsqlite3_realloc(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap, nByte) - if aNew == uintptr(0) { - (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) - return - } - (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap = aNew - (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMapAlloc = nNew - } - (*(*TFts5TokenDataMap)(unsafe.Pointer((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap + uintptr((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap)*24))).FiRowid = iRowid - (*(*TFts5TokenDataMap)(unsafe.Pointer((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap + uintptr((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap)*24))).FiPos = iPos - (*(*TFts5TokenDataMap)(unsafe.Pointer((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap + uintptr((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap)*24))).FiIter = iIter - (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap++ - } -} - -// C documentation -// -// /* // ** The iterator passed as the only argument must be a tokendata=1 iterator // ** (pIter->pTokenDataIter!=0). This function sets the iterator output // ** variables (pIter->base.*) according to the contents of the current @@ -210445,7 +213354,7 @@ func _fts5IterSetOutputsTokendata(tls *libc.TLS, pIter uintptr) { if !(ii < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnIter) { break } - p = *(*uintptr)(unsafe.Pointer(pT + 40 + uintptr(ii)*8)) + p = *(*uintptr)(unsafe.Pointer(pT + 56 + uintptr(ii)*8)) if libc.Int32FromUint8((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FbEof) == 0 { if nHit == 0 || (*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid < iRowid { iRowid = (*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid @@ -210471,7 +213380,7 @@ func _fts5IterSetOutputsTokendata(tls *libc.TLS, pIter uintptr) { (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FbEof = uint8(0) (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid = iRowid if nHit == int32(1) && eDetail == FTS5_DETAIL_FULL { - _fts5TokendataIterAppendMap(tls, (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex, pT, iMin, iRowid, int64(-int32(1))) + _fts5TokendataIterAppendMap(tls, (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex, pT, iMin, 0, iRowid, int64(-int32(1))) } else { if nHit > int32(1) && eDetail != int32(FTS5_DETAIL_NONE) { nReader = 0 @@ -210491,7 +213400,7 @@ func _fts5IterSetOutputsTokendata(tls *libc.TLS, pIter uintptr) { if !(ii < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnIter) { break } - p1 = *(*uintptr)(unsafe.Pointer(pT + 40 + uintptr(ii)*8)) + p1 = *(*uintptr)(unsafe.Pointer(pT + 56 + uintptr(ii)*8)) if iRowid == (*TFts5Iter)(unsafe.Pointer(p1)).Fbase.FiRowid { *(*int32)(unsafe.Pointer((*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaPoslistToIter + uintptr(nReader)*4)) = ii v3 = nReader @@ -210586,7 +213495,7 @@ func _fts5TokendataIterNext(tls *libc.TLS, pIter uintptr, bFrom int32, iFrom Ti6 if !(ii < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnIter) { break } - p = *(*uintptr)(unsafe.Pointer(pT + 40 + uintptr(ii)*8)) + p = *(*uintptr)(unsafe.Pointer(pT + 56 + uintptr(ii)*8)) if libc.Int32FromUint8((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FbEof) == 0 && ((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid == (*TFts5Iter)(unsafe.Pointer(pIter)).Fbase.FiRowid || bFrom != 0 && (*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid < iFrom) { _fts5MultiIterNext(tls, pIndex, p, bFrom, iFrom) for bFrom != 0 && libc.Int32FromUint8((*TFts5Iter)(unsafe.Pointer(p)).Fbase.FbEof) == 0 && (*TFts5Iter)(unsafe.Pointer(p)).Fbase.FiRowid < iFrom && (*TFts5Index)(unsafe.Pointer(pIndex)).Frc == SQLITE_OK { @@ -210638,7 +213547,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pStruct = _fts5StructureRead(tls, p) for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { if pSet != 0 { - v1 = *(*uintptr)(unsafe.Pointer(pSet + 40 + uintptr((*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FnIter-int32(1))*8)) + v1 = *(*uintptr)(unsafe.Pointer(pSet + 56 + uintptr((*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FnIter-int32(1))*8)) } else { v1 = uintptr(0) } @@ -210649,12 +213558,12 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+36886) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37300) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { - _sqlite3Fts5IterClose(tls, pNew) + _fts5IterClose(tls, pNew) break } pNewIter = pNew + 104 @@ -210746,7 +213655,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in ** not point to any terms that match the query. So delete it and break ** out of the loop - all required iterators have been collected. */ if pSmall == uintptr(0) { - _sqlite3Fts5IterClose(tls, pNew) + _fts5IterClose(tls, pNew) break } /* Append this iterator to the set and continue. */ @@ -210758,7 +213667,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in if !(ii1 < (*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FnIter) { break } - pIter = *(*uintptr)(unsafe.Pointer(pSet + 40 + uintptr(ii1)*8)) + pIter = *(*uintptr)(unsafe.Pointer(pSet + 56 + uintptr(ii1)*8)) iSeg1 = 0 for { if !(iSeg1 < (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg) { @@ -210781,6 +213690,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pRet = _fts5MultiIterAlloc(tls, p, 0) } if pRet != 0 { + (*TFts5Iter)(unsafe.Pointer(pRet)).FnSeg = 0 (*TFts5Iter)(unsafe.Pointer(pRet)).FpTokenDataIter = pSet if pSet != 0 { _fts5IterSetOutputsTokendata(tls, pRet) @@ -210820,6 +213730,11 @@ func _sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int if nToken > 0 { libc.Xmemcpy(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fp+1, pToken, libc.Uint64FromInt32(nToken)) } + /* The NOTOKENDATA flag is set when each token in a tokendata=1 table + ** should be treated individually, instead of merging all those with + ** a common prefix into a single entry. This is used, for example, by + ** queries performed as part of an integrity-check, or by the fts5vocab + ** module. */ if flags&(libc.Int32FromInt32(FTS5INDEX_QUERY_NOTOKENDATA)|libc.Int32FromInt32(FTS5INDEX_QUERY_SCAN)) != 0 { bTokendata = 0 } @@ -210866,7 +213781,7 @@ func _sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int _fts5StructureRelease(tls, pStruct) } } else { - /* Scan multiple terms in the main index */ + /* Scan multiple terms in the main index for a prefix query. */ bDesc = libc.BoolInt32(flags&int32(FTS5INDEX_QUERY_DESC) != 0) _fts5SetupPrefixIter(tls, p, bDesc, iPrefixIdx, (*(*TFts5Buffer)(unsafe.Pointer(bp + 8))).Fp, nToken+int32(1), pColset, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -210882,9 +213797,9 @@ func _sqlite3Fts5IndexQuery(tls *libc.TLS, p uintptr, pToken uintptr, nToken int } } if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { - _sqlite3Fts5IterClose(tls, *(*uintptr)(unsafe.Pointer(bp))) + _fts5IterClose(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - _sqlite3Fts5IndexCloseReader(tls, p) + _fts5IndexCloseReader(tls, p) } *(*uintptr)(unsafe.Pointer(ppIter)) = *(*uintptr)(unsafe.Pointer(bp)) _sqlite3Fts5BufferFree(tls, bp+8) @@ -210904,7 +213819,7 @@ func _sqlite3Fts5IterNext(tls *libc.TLS, pIndexIter uintptr) (r int32) { var pIter uintptr _ = pIter pIter = pIndexIter - if (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter != 0 { + if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg == 0 { _fts5TokendataIterNext(tls, pIter, 0, 0) } else { _fts5MultiIterNext(tls, (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, 0, 0) @@ -210945,7 +213860,7 @@ func _sqlite3Fts5IterNextFrom(tls *libc.TLS, pIndexIter uintptr, iMatch Ti64) (r var pIter uintptr _ = pIter pIter = pIndexIter - if (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter != 0 { + if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg == 0 { _fts5TokendataIterNext(tls, pIter, int32(1), iMatch) } else { _fts5MultiIterNextFrom(tls, (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex, pIter, iMatch) @@ -210977,23 +213892,72 @@ func _sqlite3Fts5IterTerm(tls *libc.TLS, pIndexIter uintptr, pn uintptr) (r uint // C documentation // // /* +// ** pIter is a prefix query. This function populates pIter->pTokenDataIter +// ** with an Fts5TokenDataIter object containing mappings for all rows +// ** matched by the query. +// */ +func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, nToken int32) (r int32) { + bp := tls.Alloc(32) + defer tls.Free(32) + var p uintptr + var _ /* ctx at bp+16 */ TTokendataSetupCtx + var _ /* token at bp+0 */ TFts5Buffer + _ = p + p = (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex + *(*TFts5Buffer)(unsafe.Pointer(bp)) = TFts5Buffer{} + libc.Xmemset(tls, bp+16, 0, uint64(16)) + if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { + _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) + } + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { + /* Fill in the token prefix to search for */ + *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') + libc.Xmemcpy(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp+1, pToken, libc.Uint64FromInt32(nToken)) + (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = nToken + int32(1) + _fts5VisitEntries(tls, p, uintptr(0), (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, int32(1), __ccgo_fp(_prefixIterSetupTokendataCb), bp+16) + _fts5TokendataIterSortMap(tls, p, (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT) + } + if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { + (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT + } else { + _fts5TokendataIterDelete(tls, (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT) + } + _sqlite3Fts5BufferFree(tls, bp) + return _fts5IndexReturn(tls, p) +} + +// C documentation +// +// /* // ** This is used by xInstToken() to access the token at offset iOff, column // ** iCol of row iRowid. The token is returned via output variables *ppOut // ** and *pnOut. The iterator passed as the first argument must be a tokendata=1 // ** iterator (pIter->pTokenDataIter!=0). +// ** +// ** pToken/nToken: // */ -func _sqlite3Fts5IterToken(tls *libc.TLS, pIndexIter uintptr, iRowid Ti64, iCol int32, iOff int32, ppOut uintptr, pnOut uintptr) (r int32) { - var aMap, pIter, pMap, pT uintptr - var i1, i2, iTest int32 +func _sqlite3Fts5IterToken(tls *libc.TLS, pIndexIter uintptr, pToken uintptr, nToken int32, iRowid Ti64, iCol int32, iOff int32, ppOut uintptr, pnOut uintptr) (r int32) { + var aMap, p, pIter, pMap, pT uintptr + var i1, i2, iTest, rc int32 var iPos Ti64 - _, _, _, _, _, _, _, _ = aMap, i1, i2, iPos, iTest, pIter, pMap, pT + _, _, _, _, _, _, _, _, _, _ = aMap, i1, i2, iPos, iTest, p, pIter, pMap, pT, rc pIter = pIndexIter pT = (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter - aMap = (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap iPos = int64(iCol)<<libc.Int32FromInt32(32) + int64(iOff) + aMap = uintptr(0) i1 = 0 - i2 = (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap + i2 = 0 iTest = 0 + if pT == uintptr(0) { + rc = _fts5SetupPrefixIterTokendata(tls, pIter, pToken, nToken) + if rc != SQLITE_OK { + return rc + } + pT = (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter + } + i2 = (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnMap + aMap = (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FaMap for i2 > i1 { iTest = (i1 + i2) / int32(2) if (*(*TFts5TokenDataMap)(unsafe.Pointer(aMap + uintptr(iTest)*24))).FiRowid < iRowid { @@ -211018,9 +213982,15 @@ func _sqlite3Fts5IterToken(tls *libc.TLS, pIndexIter uintptr, iRowid Ti64, iCol } } if i2 > i1 { - pMap = *(*uintptr)(unsafe.Pointer(pT + 40 + uintptr((*(*TFts5TokenDataMap)(unsafe.Pointer(aMap + uintptr(iTest)*24))).FiIter)*8)) - *(*uintptr)(unsafe.Pointer(ppOut)) = (*(*TFts5SegIter)(unsafe.Pointer(pMap + 104))).Fterm.Fp + uintptr(1) - *(*int32)(unsafe.Pointer(pnOut)) = (*(*TFts5SegIter)(unsafe.Pointer(pMap + 104))).Fterm.Fn - int32(1) + if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg == 0 { + pMap = *(*uintptr)(unsafe.Pointer(pT + 56 + uintptr((*(*TFts5TokenDataMap)(unsafe.Pointer(aMap + uintptr(iTest)*24))).FiIter)*8)) + *(*uintptr)(unsafe.Pointer(ppOut)) = (*(*TFts5SegIter)(unsafe.Pointer(pMap + 104))).Fterm.Fp + uintptr(1) + *(*int32)(unsafe.Pointer(pnOut)) = (*(*TFts5SegIter)(unsafe.Pointer(pMap + 104))).Fterm.Fn - int32(1) + } else { + p = aMap + uintptr(iTest)*24 + *(*uintptr)(unsafe.Pointer(ppOut)) = (*TFts5TokenDataIter)(unsafe.Pointer(pT)).Fterms.Fp + uintptr((*TFts5TokenDataMap)(unsafe.Pointer(p)).FiIter) + *(*int32)(unsafe.Pointer(pnOut)) = (*(*TFts5TokenDataMap)(unsafe.Pointer(aMap + uintptr(iTest)*24))).FnByte + } } return SQLITE_OK } @@ -211035,7 +214005,7 @@ func _sqlite3Fts5IndexIterClearTokendata(tls *libc.TLS, pIndexIter uintptr) { var pIter uintptr _ = pIter pIter = pIndexIter - if pIter != 0 && (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter != 0 { + if pIter != 0 && (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter != 0 && ((*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg == 0 || (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex)).FpConfig)).FeDetail != FTS5_DETAIL_FULL) { (*TFts5TokenDataIter)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter)).FnMap = 0 } } @@ -211050,28 +214020,42 @@ func _sqlite3Fts5IndexIterClearTokendata(tls *libc.TLS, pIndexIter uintptr) { // ** function. // */ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pToken uintptr, nToken int32, iRowid Ti64, iCol int32, iOff int32) (r int32) { + var iPos Ti64 var ii int32 var p, pIter, pT, pTerm uintptr - _, _, _, _, _ = ii, p, pIter, pT, pTerm + _, _, _, _, _, _ = iPos, ii, p, pIter, pT, pTerm pIter = pIndexIter pT = (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter p = (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex - ii = 0 - for { - if !(ii < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnIter) { - break + iPos = int64(iCol)<<libc.Int32FromInt32(32) + int64(iOff) + if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { + /* This is a prefix term iterator. */ + if pT == uintptr(0) { + pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } - pTerm = *(*uintptr)(unsafe.Pointer(pT + 40 + uintptr(ii)*8)) + 104 + 96 - if nToken == (*TFts5Buffer)(unsafe.Pointer(pTerm)).Fn-int32(1) && libc.Xmemcmp(tls, pToken, (*TFts5Buffer)(unsafe.Pointer(pTerm)).Fp+uintptr(1), libc.Uint64FromInt32(nToken)) == 0 { - break + if pT != 0 { + _fts5TokendataIterAppendMap(tls, p, pT, (*TFts5TokenDataIter)(unsafe.Pointer(pT)).Fterms.Fn, nToken, iRowid, iPos) + _sqlite3Fts5BufferAppendBlob(tls, p+60, pT+16, libc.Uint32FromInt32(nToken), pToken) + } + } else { + ii = 0 + for { + if !(ii < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnIter) { + break + } + pTerm = *(*uintptr)(unsafe.Pointer(pT + 56 + uintptr(ii)*8)) + 104 + 96 + if nToken == (*TFts5Buffer)(unsafe.Pointer(pTerm)).Fn-int32(1) && libc.Xmemcmp(tls, pToken, (*TFts5Buffer)(unsafe.Pointer(pTerm)).Fp+uintptr(1), libc.Uint64FromInt32(nToken)) == 0 { + break + } + goto _1 + _1: + ; + ii++ + } + if ii < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnIter { + _fts5TokendataIterAppendMap(tls, p, pT, ii, 0, iRowid, iPos) } - goto _1 - _1: - ; - ii++ - } - if ii < (*TFts5TokenDataIter)(unsafe.Pointer(pT)).FnIter { - _fts5TokendataIterAppendMap(tls, p, pT, ii, iRowid, int64(iCol)<<libc.Int32FromInt32(32)+int64(iOff)) } return _fts5IndexReturn(tls, p) } @@ -211082,14 +214066,12 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok // ** Close an iterator opened by an earlier call to sqlite3Fts5IndexQuery(). // */ func _sqlite3Fts5IterClose(tls *libc.TLS, pIndexIter uintptr) { - var pIndex, pIter uintptr - _, _ = pIndex, pIter + var pIndex uintptr + _ = pIndex if pIndexIter != 0 { - pIter = pIndexIter - pIndex = (*TFts5Iter)(unsafe.Pointer(pIter)).FpIndex - _fts5TokendataIterDelete(tls, (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter) - _fts5MultiIterFree(tls, pIter) - _sqlite3Fts5IndexCloseReader(tls, pIndex) + pIndex = (*TFts5Iter)(unsafe.Pointer(pIndexIter)).FpIndex + _fts5IterClose(tls, pIndexIter) + _fts5IndexReturn(tls, pIndex) } } @@ -211169,7 +214151,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36341, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36704, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -211763,7 +214745,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+36888, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -211994,9 +214976,9 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+36974) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37388) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { - iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32)) + iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) cksum2 ^= _sqlite3Fts5IndexEntryCksum(tls, iRowid, iCol, iTokOff, -int32(1), z, *(*int32)(unsafe.Pointer(bp + 24))) } @@ -212141,7 +215123,9 @@ type Fts5Sorter = TFts5Sorter type TFts5TokenizerModule = struct { FzName uintptr FpUserData uintptr - Fx Tfts5_tokenizer + FbV2Native int32 + Fx1 Tfts5_tokenizer + Fx2 Tfts5_tokenizer_v2 FxDestroy uintptr FpNext uintptr } @@ -212192,18 +215176,24 @@ type Fts5TransactionState = TFts5TransactionState ** all registered FTS5 extensions - tokenizers and auxiliary functions. */ type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr + Fapi Tfts5_api + Fdb uintptr + FiNextId Ti64 + FpAux uintptr + FpTok uintptr + FpDfltTok uintptr + FpCsr uintptr + FaLocaleHdr [4]Tu32 } type Fts5Global1 = TFts5Global1 /* +** Size of header on fts5_locale() values. And macro to access a buffer +** containing a copy of the header from an Fts5Config pointer. + */ + +/* ** Each auxiliary function registered with the FTS5 module is represented ** by an object of the following type. All such objects are stored as part ** of the Fts5Global.pAux list. @@ -212223,11 +215213,28 @@ type Fts5Auxiliary1 = TFts5Auxiliary1 ** Each tokenizer module registered with the FTS5 module is represented ** by an object of the following type. All such objects are stored as part ** of the Fts5Global.pTok list. +** +** bV2Native: +** True if the tokenizer was registered using xCreateTokenizer_v2(), false +** for xCreateTokenizer(). If this variable is true, then x2 is populated +** with the routines as supplied by the caller and x1 contains synthesized +** wrapper routines. In this case the user-data pointer passed to +** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, +** not a copy of pUserData. +** +** Of course, if bV2Native is false, then x1 contains the real routines and +** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule +** object should be passed to x2.xCreate. +** +** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) +** calls. */ type TFts5TokenizerModule1 = struct { FzName uintptr FpUserData uintptr - Fx Tfts5_tokenizer + FbV2Native int32 + Fx1 Tfts5_tokenizer + Fx2 Tfts5_tokenizer_v2 FxDestroy uintptr FpNext uintptr } @@ -212344,10 +215351,15 @@ type Fts5Auxdata1 = TFts5Auxdata1 // C documentation // // /* -// ** Return true if pTab is a contentless table. +// ** Return true if pTab is a contentless table. If parameter bIncludeUnindexed +// ** is true, this includes contentless tables that store UNINDEXED columns +// ** only. // */ -func _fts5IsContentless(tls *libc.TLS, pTab uintptr) (r int32) { - return libc.BoolInt32((*TFts5Config)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FeContent == int32(FTS5_CONTENT_NONE)) +func _fts5IsContentless(tls *libc.TLS, pTab uintptr, bIncludeUnindexed int32) (r int32) { + var eContent int32 + _ = eContent + eContent = (*TFts5Config)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FeContent + return libc.BoolInt32(eContent == int32(FTS5_CONTENT_NONE) || bIncludeUnindexed != 0 && eContent == int32(FTS5_CONTENT_UNINDEXED)) } // C documentation @@ -212422,8 +215434,12 @@ func _fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5ConfigParse(tls, pGlobal, db, argc, azConfig, bp+8, pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { + (*TFts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpzErrmsg = pzErr (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig = *(*uintptr)(unsafe.Pointer(bp + 8)) (*TFts5FullTable)(unsafe.Pointer(pTab)).FpGlobal = pGlobal + if bCreate != 0 || _sqlite3Fts5TokenizerPreload(tls, *(*uintptr)(unsafe.Pointer(bp + 8))+128) != 0 { + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5LoadTokenizer(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) + } } /* Open the index sub-system */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -212439,10 +215455,7 @@ func _fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc } /* Load the initial configuration */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpzErrmsg = pzErr - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexLoadConfig(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) - _sqlite3Fts5IndexRollback(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) - (*TFts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpzErrmsg = uintptr(0) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5ConfigLoad(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig, (*TFts5Config)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FiCookie-int32(1)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FeContent == FTS5_CONTENT_NORMAL { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+24, libc.Int32FromInt32(1))) @@ -212450,6 +215463,9 @@ func _fts5InitVtab(tls *libc.TLS, bCreate int32, db uintptr, pAux uintptr, argc if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_INNOCUOUS), 0) } + if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { + (*TFts5Config)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpzErrmsg = uintptr(0) + } if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { _fts5FreeVtab(tls, pTab) pTab = uintptr(0) @@ -212491,10 +215507,10 @@ func _fts5SetUniqueFlag(tls *libc.TLS, pIdxInfo uintptr) { } func _fts5UsePatternMatch(tls *libc.TLS, pConfig uintptr, p uintptr) (r int32) { - if (*TFts5Config)(unsafe.Pointer(pConfig)).FePattern == int32(FTS5_PATTERN_GLOB) && libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_GLOB) { + if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FePattern == int32(FTS5_PATTERN_GLOB) && libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_GLOB) { return int32(1) } - if (*TFts5Config)(unsafe.Pointer(pConfig)).FePattern == int32(FTS5_PATTERN_LIKE) && (libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_LIKE) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_GLOB)) { + if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FePattern == int32(FTS5_PATTERN_LIKE) && (libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_LIKE) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(FTS5_PATTERN_GLOB)) { return int32(1) } return 0 @@ -212541,10 +215557,10 @@ func _fts5UsePatternMatch(tls *libc.TLS, pConfig uintptr, p uintptr) (r int32) { // ** This function ensures that there is at most one "r" or "=". And that if // ** there exists an "=" then there is no "<" or ">". // ** -// ** Costs are assigned as follows: +// ** If an unusable MATCH operator is present in the WHERE clause, then +// ** SQLITE_CONSTRAINT is returned. // ** -// ** a) If an unusable MATCH operator is present in the WHERE clause, the -// ** cost is unconditionally set to 1e50 (a really big number). +// ** Costs are assigned as follows: // ** // ** a) If a MATCH operator is present, the cost depends on the other // ** constraints also present. As follows: @@ -212566,10 +215582,10 @@ func _fts5UsePatternMatch(tls *libc.TLS, pConfig uintptr, p uintptr) (r int32) { func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var bSeenEq, bSeenGt, bSeenLt, bSeenMatch, bSeenRank, i, iCol, iCons, iIdxStr, iSort, idxFlags, nCol, op, v11, v12, v13, v14, v2, v3, v4, v5, v6, v7, v8, v9 int32 + var bSeenEq, bSeenGt, bSeenLt, bSeenRank, i, iCol, iCons, iIdxStr, iSort, idxFlags, nCol, nSeenMatch, op, v11, v12, v13, v14, v2, v3, v4, v5, v6, v7, v8, v9 int32 var idxStr, p, p1, pConfig, pTab uintptr var v15, v16, v17, v18 float64 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bSeenEq, bSeenGt, bSeenLt, bSeenMatch, bSeenRank, i, iCol, iCons, iIdxStr, iSort, idxFlags, idxStr, nCol, op, p, p1, pConfig, pTab, v11, v12, v13, v14, v15, v16, v17, v18, v2, v3, v4, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bSeenEq, bSeenGt, bSeenLt, bSeenRank, i, iCol, iCons, iIdxStr, iSort, idxFlags, idxStr, nCol, nSeenMatch, op, p, p1, pConfig, pTab, v11, v12, v13, v14, v15, v16, v17, v18, v2, v3, v4, v5, v6, v7, v8, v9 pTab = pVTab pConfig = (*TFts5Table)(unsafe.Pointer(pTab)).FpConfig nCol = (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol @@ -212579,10 +215595,10 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) bSeenEq = 0 bSeenGt = 0 bSeenLt = 0 - bSeenMatch = 0 + nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+36979, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37393, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -212602,10 +215618,9 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) /* A MATCH operator or equivalent */ if libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fusable) == 0 || iCol < 0 { /* As there exists an unusable MATCH constraint this is an - ** unusable plan. Set a prohibitively high cost. */ - (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = float64(1e+50) + ** unusable plan. Return SQLITE_CONSTRAINT. */ *(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr))) = uint8(0) - return SQLITE_OK + return int32(SQLITE_CONSTRAINT) } else { if iCol == nCol+int32(1) { if bSeenRank != 0 { @@ -212616,14 +215631,12 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) *(*uint8)(unsafe.Pointer(idxStr + uintptr(v2))) = uint8('r') bSeenRank = int32(1) } else { - if iCol >= 0 { - bSeenMatch = int32(1) - v3 = iIdxStr - iIdxStr++ - *(*uint8)(unsafe.Pointer(idxStr + uintptr(v3))) = uint8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5202, libc.VaList(bp+8, iCol)) - idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) - } + nSeenMatch++ + v3 = iIdxStr + iIdxStr++ + *(*uint8)(unsafe.Pointer(idxStr + uintptr(v3))) = uint8('M') + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5203, libc.VaList(bp+8, iCol)) + idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ v4 = iCons @@ -212641,11 +215654,12 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*uint8)(unsafe.Pointer(idxStr + uintptr(v5))) = libc.Uint8FromInt32(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5202, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5203, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaConstraintUsage + uintptr(i)*8))).FargvIndex = v7 + nSeenMatch++ } else { if bSeenEq == 0 && libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(p)).Fop) == int32(SQLITE_INDEX_CONSTRAINT_EQ) && iCol < 0 { v8 = iIdxStr @@ -212712,7 +215726,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) */ if (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnOrderBy == int32(1) { iSort = (*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy))).FiColumn - if iSort == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol+int32(1) && bSeenMatch != 0 { + if iSort == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol+int32(1) && nSeenMatch > 0 { idxFlags |= int32(FTS5_BI_ORDER_RANK) } else { if iSort == -int32(1) && (!((*(*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FaOrderBy))).Fdesc != 0) || !((*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata != 0)) { @@ -212728,34 +215742,34 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) } /* Calculate the estimated cost based on the flags set in idxFlags. */ if bSeenEq != 0 { - if bSeenMatch != 0 { - v15 = float64(100) + if nSeenMatch != 0 { + v15 = float64(1000) } else { v15 = float64(10) } (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = v15 - if bSeenMatch == 0 { + if nSeenMatch == 0 { _fts5SetUniqueFlag(tls, pInfo) } } else { if bSeenLt != 0 && bSeenGt != 0 { - if bSeenMatch != 0 { - v16 = float64(500) + if nSeenMatch != 0 { + v16 = float64(5000) } else { v16 = float64(250000) } (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = v16 } else { if bSeenLt != 0 || bSeenGt != 0 { - if bSeenMatch != 0 { - v17 = float64(750) + if nSeenMatch != 0 { + v17 = float64(7500) } else { v17 = float64(750000) } (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FestimatedCost = v17 } else { - if bSeenMatch != 0 { - v18 = float64(1000) + if nSeenMatch != 0 { + v18 = float64(10000) } else { v18 = float64(1e+06) } @@ -212763,6 +215777,17 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) } } } + i = int32(1) + for { + if !(i < nSeenMatch) { + break + } + *(*float64)(unsafe.Pointer(pInfo + 64)) *= float64(0.4) + goto _19 + _19: + ; + i++ + } (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FidxNum = idxFlags return SQLITE_OK } @@ -212810,7 +215835,7 @@ func _fts5OpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize = pCsr + 1*184 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpNext = (*TFts5Global)(unsafe.Pointer(pGlobal)).FpCsr (*TFts5Global)(unsafe.Pointer(pGlobal)).FpCsr = pCsr - v2 = pGlobal + 40 + v2 = pGlobal + 56 *(*Ti64)(unsafe.Pointer(v2))++ v1 = *(*Ti64)(unsafe.Pointer(v2)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId = v1 @@ -212905,7 +215930,7 @@ func _fts5CloseMethod(tls *libc.TLS, pCursor uintptr) (r int32) { pCsr = pCursor _fts5FreeCursorComponents(tls, pCsr) /* Remove the cursor from the Fts5Global.pCsr list */ - pp = (*TFts5FullTable)(unsafe.Pointer(pTab)).FpGlobal + 72 + pp = (*TFts5FullTable)(unsafe.Pointer(pTab)).FpGlobal + 88 for { if !(*(*uintptr)(unsafe.Pointer(pp)) != pCsr) { break @@ -213079,10 +216104,11 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK + *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_REQUIRE_DOCSIZE) } break } @@ -213106,7 +216132,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -213141,21 +216167,21 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15083 + v1 = __ccgo_ts + 15145 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } if zRankArgs != 0 { v2 = zRankArgs } else { - v2 = __ccgo_ts + 1662 + v2 = __ccgo_ts + 1663 } if bDesc != 0 { - v3 = __ccgo_ts + 37018 + v3 = __ccgo_ts + 37432 } else { - v3 = __ccgo_ts + 37023 + v3 = __ccgo_ts + 37437 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37027, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37441, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -213213,14 +216239,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37082, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37496, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5545, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5562, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37088, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37502, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -213270,7 +216296,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37116, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37530, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -213303,7 +216329,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37126, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37540, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -213337,7 +216363,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37147, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37561, libc.VaList(bp+24, z)) } } } else { @@ -213345,7 +216371,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35079 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35288 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -213367,6 +216393,156 @@ func _fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault Ti64) (r Ti64) { // C documentation // // /* +// ** Set the error message on the virtual table passed as the first argument. +// */ +func _fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { + var ap Tva_list + _ = ap /* ... printf arguments */ + ap = va + Xsqlite3_free(tls, (*TFts5FullTable)(unsafe.Pointer(p)).Fp.Fbase.FzErrMsg) + (*TFts5FullTable)(unsafe.Pointer(p)).Fp.Fbase.FzErrMsg = Xsqlite3_vmprintf(tls, zFormat, ap) + _ = ap +} + +// C documentation +// +// /* +// ** Arrange for subsequent calls to sqlite3Fts5Tokenize() to use the locale +// ** specified by pLocale/nLocale. The buffer indicated by pLocale must remain +// ** valid until after the final call to sqlite3Fts5Tokenize() that will use +// ** the locale. +// */ +func _sqlite3Fts5SetLocale(tls *libc.TLS, pConfig uintptr, zLocale uintptr, nLocale int32) { + var pT uintptr + _ = pT + pT = pConfig + 128 + (*TFts5TokenizerConfig)(unsafe.Pointer(pT)).FpLocale = zLocale + (*TFts5TokenizerConfig)(unsafe.Pointer(pT)).FnLocale = nLocale +} + +// C documentation +// +// /* +// ** Clear any locale configured by an earlier call to sqlite3Fts5SetLocale(). +// */ +func _sqlite3Fts5ClearLocale(tls *libc.TLS, pConfig uintptr) { + _sqlite3Fts5SetLocale(tls, pConfig, uintptr(0), 0) +} + +// C documentation +// +// /* +// ** Return true if the value passed as the only argument is an +// ** fts5_locale() value. +// */ +func _sqlite3Fts5IsLocaleValue(tls *libc.TLS, pConfig uintptr, pVal uintptr) (r int32) { + var nBlob, ret int32 + var pBlob uintptr + _, _, _ = nBlob, pBlob, ret + ret = 0 + if Xsqlite3_value_type(tls, pVal) == int32(SQLITE_BLOB) { + /* Call sqlite3_value_bytes() after sqlite3_value_blob() in this case. + ** If the blob was created using zeroblob(), then sqlite3_value_blob() + ** may call malloc(). If this malloc() fails, then the values returned + ** by both value_blob() and value_bytes() will be 0. If value_bytes() were + ** called first, then the NULL pointer returned by value_blob() might + ** be dereferenced. */ + pBlob = Xsqlite3_value_blob(tls, pVal) + nBlob = Xsqlite3_value_bytes(tls, pVal) + if nBlob > libc.Int32FromInt64(16) && 0 == libc.Xmemcmp(tls, pBlob, (*TFts5Config)(unsafe.Pointer(pConfig)).FpGlobal+96, libc.Uint64FromInt32(libc.Int32FromInt64(16))) { + ret = int32(1) + } + } + return ret +} + +// C documentation +// +// /* +// ** Value pVal is guaranteed to be an fts5_locale() value, according to +// ** sqlite3Fts5IsLocaleValue(). This function extracts the text and locale +// ** from the value and returns them separately. +// ** +// ** If successful, SQLITE_OK is returned and (*ppText) and (*ppLoc) set +// ** to point to buffers containing the text and locale, as utf-8, +// ** respectively. In this case output parameters (*pnText) and (*pnLoc) are +// ** set to the sizes in bytes of these two buffers. +// ** +// ** Or, if an error occurs, then an SQLite error code is returned. The final +// ** value of the four output parameters is undefined in this case. +// */ +func _sqlite3Fts5DecodeLocaleValue(tls *libc.TLS, pVal uintptr, ppText uintptr, pnText uintptr, ppLoc uintptr, pnLoc uintptr) (r int32) { + var n, nLoc int32 + var p uintptr + _, _, _ = n, nLoc, p + p = Xsqlite3_value_blob(tls, pVal) + n = Xsqlite3_value_bytes(tls, pVal) + nLoc = 0 + nLoc = libc.Int32FromInt64(16) + for { + if !(*(*uint8)(unsafe.Pointer(p + uintptr(nLoc))) != 0) { + break + } + if nLoc == n-int32(1) { + return int32(SQLITE_MISMATCH) + } + goto _1 + _1: + ; + nLoc++ + } + *(*uintptr)(unsafe.Pointer(ppLoc)) = p + uintptr(libc.Int32FromInt64(16)) + *(*int32)(unsafe.Pointer(pnLoc)) = nLoc - libc.Int32FromInt64(16) + *(*uintptr)(unsafe.Pointer(ppText)) = p + uintptr(nLoc+int32(1)) + *(*int32)(unsafe.Pointer(pnText)) = n - nLoc - int32(1) + return SQLITE_OK +} + +// C documentation +// +// /* +// ** Argument pVal is the text of a full-text search expression. It may or +// ** may not have been wrapped by fts5_locale(). This function extracts +// ** the text of the expression, and sets output variable (*pzText) to +// ** point to a nul-terminated buffer containing the expression. +// ** +// ** If pVal was an fts5_locale() value, then sqlite3Fts5SetLocale() is called +// ** to set the tokenizer to use the specified locale. +// ** +// ** If output variable (*pbFreeAndReset) is set to true, then the caller +// ** is required to (a) call sqlite3Fts5ClearLocale() to reset the tokenizer +// ** locale, and (b) call sqlite3_free() to free (*pzText). +// */ +func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText uintptr, pbFreeAndReset uintptr) (r int32) { + bp := tls.Alloc(64) + defer tls.Free(64) + var _ /* nLoc at bp+32 */ int32 + var _ /* nText at bp+16 */ int32 + var _ /* pLoc at bp+24 */ uintptr + var _ /* pText at bp+8 */ uintptr + var _ /* rc at bp+0 */ int32 + *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK + if _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 16)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 32)) = 0 + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37594, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { + _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) + } + *(*int32)(unsafe.Pointer(pbFreeAndReset)) = int32(1) + } else { + *(*uintptr)(unsafe.Pointer(pzText)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(pbFreeAndReset)) = 0 + } + return *(*int32)(unsafe.Pointer(bp)) +} + +// C documentation +// +// /* // ** This is the xFilter interface for the virtual table. See // ** the virtual table xFilter method documentation for additional // ** information. @@ -213378,12 +216554,14 @@ func _fts5GetRowidLimit(tls *libc.TLS, pVal uintptr, iDefault Ti64) (r Ti64) { // ** 3. A full-table scan. // */ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, nVal int32, apVal uintptr) (r int32) { - bp := tls.Alloc(32) - defer tls.Free(32) - var bDesc, bGlob, bOrderByRank, i, iCol, iIdxStr, rc, v2, v3, v4, v5, v7 int32 - var pConfig, pCsr, pRank, pRowidEq, pRowidGe, pRowidLe, pTab, pzErr, pzErrmsg, zText, zText1, v6 uintptr + bp := tls.Alloc(48) + defer tls.Free(48) + var bDesc, bGlob, bInternal, bOrderByRank, bPrefixInsttoken, i, iCol, iIdxStr, rc, v2, v3, v4, v5, v7 int32 + var pConfig, pCsr, pRank, pRowidEq, pRowidGe, pRowidLe, pTab, pzErr, pzErrmsg, zText1, v6 uintptr + var _ /* bFreeAndReset at bp+16 */ int32 var _ /* pExpr at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bDesc, bGlob, bOrderByRank, i, iCol, iIdxStr, pConfig, pCsr, pRank, pRowidEq, pRowidGe, pRowidLe, pTab, pzErr, pzErrmsg, rc, zText, zText1, v2, v3, v4, v5, v6, v7 + var _ /* zText at bp+8 */ uintptr + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bDesc, bGlob, bInternal, bOrderByRank, bPrefixInsttoken, i, iCol, iIdxStr, pConfig, pCsr, pRank, pRowidEq, pRowidGe, pRowidLe, pTab, pzErr, pzErrmsg, rc, zText1, v2, v3, v4, v5, v6, v7 pTab = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab pConfig = (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig pCsr = pCursor @@ -213393,12 +216571,9 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint pRowidLe = uintptr(0) /* rowid <= ? expression (or NULL) */ pRowidGe = uintptr(0) /* Column on LHS of MATCH operator */ pzErrmsg = (*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg + bPrefixInsttoken = (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken iIdxStr = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+36979, 0) - return int32(SQLITE_ERROR) - } if (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan != 0 { _fts5FreeCursorComponents(tls, pCsr) libc.Xmemset(tls, pCsr+32, 0, uint64(184)-libc.Uint64FromInt64(int64(pCsr+32)-int64(pCsr))) @@ -213416,31 +216591,44 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint case int32('r'): pRank = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) case int32('M'): - zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) - if zText == uintptr(0) { - zText = __ccgo_ts + 1662 + *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 16)) = 0 + bInternal = 0 + rc = _fts5ExtractExprText(tls, pConfig, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)), bp+8, bp+16) + if rc != SQLITE_OK { + goto filter_out + } + if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) { + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1663 + } + if Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) == uint32(FTS5_INSTTOKEN_SUBTYPE) { + (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = int32(1) } iCol = 0 for cond := true; cond; cond = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) <= int32('9') { iCol = iCol*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(idxStr + uintptr(iIdxStr)))) - int32('0')) iIdxStr++ } - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zText))) == int32('*') { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8))))) == int32('*') { /* The user has issued a query of the form "MATCH '*...'". This ** indicates that the MATCH expression is not a full text query, ** but a request for an internal parameter. */ - rc = _fts5SpecialMatch(tls, pTab, pCsr, zText+1) - goto filter_out + rc = _fts5SpecialMatch(tls, pTab, pCsr, *(*uintptr)(unsafe.Pointer(bp + 8))+1) + bInternal = int32(1) } else { pzErr = pTab + 16 - rc = _sqlite3Fts5ExprNew(tls, pConfig, 0, iCol, zText, bp, pzErr) + rc = _sqlite3Fts5ExprNew(tls, pConfig, 0, iCol, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, pzErr) if rc == SQLITE_OK { rc = _sqlite3Fts5ExprAnd(tls, pCsr+64, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } - if rc != SQLITE_OK { - goto filter_out - } + } + if *(*int32)(unsafe.Pointer(bp + 16)) != 0 { + Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) + _sqlite3Fts5ClearLocale(tls, pConfig) + } + if bInternal != 0 || rc != SQLITE_OK { + goto filter_out } case int32('L'): fallthrough @@ -213540,7 +216728,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+37180, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37599, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -213569,6 +216757,7 @@ filter_out: ; _sqlite3Fts5ExprFree(tls, *(*uintptr)(unsafe.Pointer(bp))) (*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = pzErrmsg + (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = bPrefixInsttoken return rc } @@ -213600,7 +216789,11 @@ func _fts5CursorRowid(tls *libc.TLS, pCsr uintptr) (r Ti64) { if (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 { return (*TFts5Sorter)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid } else { - return _sqlite3Fts5ExprRowid(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) + if (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan >= int32(FTS5_PLAN_SCAN) { + return Xsqlite3_column_int64(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 0) + } else { + return _sqlite3Fts5ExprRowid(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) + } } return r } @@ -213619,18 +216812,10 @@ func _fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) _, _ = ePlan, pCsr pCsr = pCursor ePlan = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan - switch ePlan { - case int32(FTS5_PLAN_SPECIAL): + if ePlan == int32(FTS5_PLAN_SPECIAL) { *(*Tsqlite_int64)(unsafe.Pointer(pRowid)) = 0 - case int32(FTS5_PLAN_SOURCE): - fallthrough - case int32(FTS5_PLAN_MATCH): - fallthrough - case int32(FTS5_PLAN_SORTED_MATCH): + } else { *(*Tsqlite_int64)(unsafe.Pointer(pRowid)) = _fts5CursorRowid(tls, pCsr) - default: - *(*Tsqlite_int64)(unsafe.Pointer(pRowid)) = Xsqlite3_column_int64(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, 0) - break } return SQLITE_OK } @@ -213645,8 +216830,8 @@ func _fts5RowidMethod(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) // ** be left in sqlite3_vtab.zErrMsg. // */ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { - bp := tls.Alloc(16) - defer tls.Free(16) + bp := tls.Alloc(32) + defer tls.Free(32) var eStmt, rc int32 var pTab, pTab1, v1 uintptr _, _, _, _, _ = eStmt, pTab, pTab1, rc, v1 @@ -213676,9 +216861,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) + _fts5SetVtabError(tls, pTab1, __ccgo_ts+37635, libc.VaList(bp+8, _fts5CursorRowid(tls, pCsr), (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer(pTab1)).FpConfig)).FzContent)) } else { if (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer(pTab1)).FpConfig)).FpzErrmsg != 0 { - *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer(pTab1)).FpConfig)).FpzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer(pTab1)).FpConfig)).Fdb))) + _fts5SetVtabError(tls, pTab1, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer(pTab1)).FpConfig)).Fdb))) } } } @@ -213686,14 +216872,6 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { return rc } -func _fts5SetVtabError(tls *libc.TLS, p uintptr, zFormat uintptr, va uintptr) { - var ap Tva_list - _ = ap /* ... printf arguments */ - ap = va - (*TFts5FullTable)(unsafe.Pointer(p)).Fp.Fbase.FzErrMsg = Xsqlite3_vmprintf(tls, zFormat, ap) - _ = ap -} - // C documentation // // /* @@ -213722,36 +216900,36 @@ func _fts5SpecialInsert(tls *libc.TLS, pTab uintptr, zCmd uintptr, pVal uintptr) rc = SQLITE_OK *(*int32)(unsafe.Pointer(bp)) = 0 bLoadConfig = 0 - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37216, zCmd) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37680, zCmd) { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37227, 0) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37691, 0) rc = int32(SQLITE_ERROR) } else { rc = _sqlite3Fts5StorageDeleteAll(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } bLoadConfig = int32(1) } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37307, zCmd) { - if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_NONE) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37315, 0) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37771, zCmd) { + if _fts5IsContentless(tls, pTab, int32(1)) != 0 { + _fts5SetVtabError(tls, pTab, __ccgo_ts+37779, 0) rc = int32(SQLITE_ERROR) } else { rc = _sqlite3Fts5StorageRebuild(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } bLoadConfig = int32(1) } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+17448, zCmd) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+17513, zCmd) { rc = _sqlite3Fts5StorageOptimize(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage) } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37371, zCmd) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37835, zCmd) { nMerge = Xsqlite3_value_int(tls, pVal) rc = _sqlite3Fts5StorageMerge(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, nMerge) } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37377, zCmd) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37841, zCmd) { iArg = Xsqlite3_value_int(tls, pVal) rc = _sqlite3Fts5StorageIntegrity(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iArg) } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37393, zCmd) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+37857, zCmd) { rc = _sqlite3Fts5FlushToDisk(tls, pTab) } else { rc = _sqlite3Fts5FlushToDisk(tls, pTab) @@ -213789,7 +216967,7 @@ func _fts5SpecialDelete(tls *libc.TLS, pTab uintptr, apVal uintptr) (r int32) { eType1 = Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) if eType1 == int32(SQLITE_INTEGER) { iDel = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) - rc = _sqlite3Fts5StorageDelete(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iDel, apVal+2*8) + rc = _sqlite3Fts5StorageDelete(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iDel, apVal+2*8, 0) } return rc } @@ -213799,7 +216977,7 @@ func _fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, _ = rc rc = *(*int32)(unsafe.Pointer(pRc)) if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageContentInsert(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, piRowid) + rc = _sqlite3Fts5StorageContentInsert(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, 0, apVal, piRowid) } if rc == SQLITE_OK { rc = _sqlite3Fts5StorageIndexInsert(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, *(*Ti64)(unsafe.Pointer(piRowid))) @@ -213810,6 +216988,73 @@ func _fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, // C documentation // // /* +// ** +// ** This function is called when the user attempts an UPDATE on a contentless +// ** table. Parameter bRowidModified is true if the UPDATE statement modifies +// ** the rowid value. Parameter apVal[] contains the new values for each user +// ** defined column of the fts5 table. pConfig is the configuration object of the +// ** table being updated (guaranteed to be contentless). The contentless_delete=1 +// ** and contentless_unindexed=1 options may or may not be set. +// ** +// ** This function returns SQLITE_OK if the UPDATE can go ahead, or an SQLite +// ** error code if it cannot. In this case an error message is also loaded into +// ** pConfig. Output parameter (*pbContent) is set to true if the caller should +// ** update the %_content table only - not the FTS index or any other shadow +// ** table. This occurs when an UPDATE modifies only UNINDEXED columns of the +// ** table. +// ** +// ** An UPDATE may proceed if: +// ** +// ** * The only columns modified are UNINDEXED columns, or +// ** +// ** * The contentless_delete=1 option was specified and all of the indexed +// ** columns (not a subset) have been modified. +// */ +func _fts5ContentlessUpdate(tls *libc.TLS, pConfig uintptr, apVal uintptr, bRowidModified int32, pbContent uintptr) (r int32) { + bp := tls.Alloc(32) + defer tls.Free(32) + var bSeenIndex, bSeenIndexNC, ii, rc int32 + var v2 uintptr + _, _, _, _, _ = bSeenIndex, bSeenIndexNC, ii, rc, v2 + bSeenIndex = 0 /* Have seen modified indexed column */ + bSeenIndexNC = 0 /* Have seen unmodified indexed column */ + rc = SQLITE_OK + ii = 0 + for { + if !(ii < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { + break + } + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(ii)))) == 0 { + if Xsqlite3_value_nochange(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(ii)*8))) != 0 { + bSeenIndexNC++ + } else { + bSeenIndex++ + } + } + goto _1 + _1: + ; + ii++ + } + if bSeenIndex == 0 && bRowidModified == 0 { + *(*int32)(unsafe.Pointer(pbContent)) = int32(1) + } else { + if bSeenIndexNC != 0 || (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete == 0 { + rc = int32(SQLITE_ERROR) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { + v2 = __ccgo_ts + 37863 + } else { + v2 = __ccgo_ts + 37923 + } + _sqlite3Fts5ConfigErrmsg(tls, pConfig, v2, libc.VaList(bp+8, __ccgo_ts+37953, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + } + } + return rc +} + +// C documentation +// +// /* // ** This function is the implementation of the xUpdate callback used by // ** FTS3 virtual tables. It is invoked by SQLite each time a row is to be // ** inserted, updated or deleted. @@ -213826,18 +217071,18 @@ func _fts5StorageInsert(tls *libc.TLS, pRc uintptr, pTab uintptr, apVal uintptr, func _fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, pRowid uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - var bUpdateOrDelete, eConflict, eType0, eType1 int32 + var eConflict, eType0, eType1, ii int32 var iDel, iNew, iNew1, iOld Ti64 - var pConfig, pTab, z, v1 uintptr + var pConfig, pStorage, pTab, pVal, z uintptr + var _ /* bContent at bp+4 */ int32 var _ /* rc at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _ = bUpdateOrDelete, eConflict, eType0, eType1, iDel, iNew, iNew1, iOld, pConfig, pTab, z, v1 + _, _, _, _, _, _, _, _, _, _, _, _, _ = eConflict, eType0, eType1, iDel, iNew, iNew1, iOld, ii, pConfig, pStorage, pTab, pVal, z pTab = pVtab pConfig = (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig /* value_type() of apVal[0] */ *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK /* Return code */ - bUpdateOrDelete = 0 /* A transaction must be open when this is called. */ if (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz == 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexLoadConfig(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5ConfigLoad(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig, (*TFts5Config)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FiCookie) if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp)) } @@ -213849,13 +217094,12 @@ func _fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, if eType0 == int32(SQLITE_NULL) && Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(int32(2)+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*8))) != int32(SQLITE_NULL) { /* A "special" INSERT op. These are handled separately. */ z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(int32(2)+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*8))) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+17968, z) { + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+18033, z) { if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37399, 0) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37967, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { *(*int32)(unsafe.Pointer(bp)) = _fts5SpecialDelete(tls, pTab, apVal) - bUpdateOrDelete = int32(1) } } else { *(*int32)(unsafe.Pointer(bp)) = _fts5SpecialInsert(tls, pTab, z, *(*uintptr)(unsafe.Pointer(apVal + uintptr(int32(2)+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol+int32(1))*8))) @@ -213876,71 +217120,104 @@ func _fts5UpdateMethod(tls *libc.TLS, pVtab uintptr, nArg int32, apVal uintptr, if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { eConflict = Xsqlite3_vtab_on_conflict(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb) } - /* Filter out attempts to run UPDATE or DELETE on contentless tables. - ** This is not suported. Except - they are both supported if the CREATE - ** VIRTUAL TABLE statement contained "contentless_delete=1". */ - if eType0 == int32(SQLITE_INTEGER) && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_NONE) && (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete == 0 { - if nArg > int32(1) { - v1 = __ccgo_ts + 21001 + /* DELETE */ + if nArg == int32(1) { + /* It is only possible to DELETE from a contentless table if the + ** contentless_delete=1 flag is set. */ + if _fts5IsContentless(tls, pTab, int32(1)) != 0 && (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete == 0 { + _fts5SetVtabError(tls, pTab, __ccgo_ts+38026, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { - v1 = __ccgo_ts + 37458 + iDel = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal))) /* Rowid to delete */ + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iDel, uintptr(0), 0) } - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37470, libc.VaList(bp+16, v1, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) - *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { - if nArg == int32(1) { - iDel = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal))) /* Rowid to delete */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iDel, uintptr(0)) - bUpdateOrDelete = int32(1) + eType1 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) + /* It is an error to write an fts5_locale() value to a table without + ** the locale=1 option. */ + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale == 0 { + ii = 0 + for { + if !(ii < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { + break + } + pVal = *(*uintptr)(unsafe.Pointer(apVal + uintptr(ii+int32(2))*8)) + if _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { + _fts5SetVtabError(tls, pTab, __ccgo_ts+38072, 0) + *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISMATCH) + goto update_out + } + goto _1 + _1: + ; + ii++ + } + } + if eType0 != int32(SQLITE_INTEGER) { + /* An INSERT statement. If the conflict-mode is REPLACE, first remove + ** the current entry (if any). */ + if eConflict == int32(SQLITE_REPLACE) && eType1 == int32(SQLITE_INTEGER) { + iNew = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) /* Rowid to delete */ + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iNew, uintptr(0), 0) + } + _fts5StorageInsert(tls, bp, pTab, apVal, pRowid) } else { - eType1 = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) - if eType1 != int32(SQLITE_INTEGER) && eType1 != int32(SQLITE_NULL) { + pStorage = (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage + iOld = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal))) /* Old rowid */ + iNew1 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) /* New rowid */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* Content only update */ + /* If this is a contentless table (including contentless_unindexed=1 + ** tables), check if the UPDATE may proceed. */ + if _fts5IsContentless(tls, pTab, int32(1)) != 0 { + *(*int32)(unsafe.Pointer(bp)) = _fts5ContentlessUpdate(tls, pConfig, apVal+2*8, libc.BoolInt32(iOld != iNew1), bp+4) + if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { + goto update_out + } + } + if eType1 != int32(SQLITE_INTEGER) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISMATCH) } else { - if eType0 != int32(SQLITE_INTEGER) { - /* An INSERT statement. If the conflict-mode is REPLACE, first remove - ** the current entry (if any). */ - if eConflict == int32(SQLITE_REPLACE) && eType1 == int32(SQLITE_INTEGER) { - iNew = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) /* Rowid to delete */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iNew, uintptr(0)) - bUpdateOrDelete = int32(1) + if iOld != iNew1 { + if eConflict == int32(SQLITE_REPLACE) { + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, pStorage, iOld, uintptr(0), int32(1)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, pStorage, iNew1, uintptr(0), 0) + } + _fts5StorageInsert(tls, bp, pTab, apVal, pRowid) + } else { + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageFindDeleteRow(tls, pStorage, iOld) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageContentInsert(tls, pStorage, 0, apVal, pRowid) + } + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, pStorage, iOld, uintptr(0), 0) + } + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageIndexInsert(tls, pStorage, apVal, *(*Tsqlite_int64)(unsafe.Pointer(pRowid))) + } } - _fts5StorageInsert(tls, bp, pTab, apVal, pRowid) } else { - iOld = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal))) /* Old rowid */ - iNew1 = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) /* New rowid */ - if eType1 == int32(SQLITE_INTEGER) && iOld != iNew1 { - if eConflict == int32(SQLITE_REPLACE) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0)) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iNew1, uintptr(0)) - } - _fts5StorageInsert(tls, bp, pTab, apVal, pRowid) - } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageContentInsert(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, pRowid) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0)) - } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageIndexInsert(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, apVal, *(*Tsqlite_int64)(unsafe.Pointer(pRowid))) - } + if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { + /* This occurs when an UPDATE on a contentless table affects *only* + ** UNINDEXED columns. This is a no-op for contentless_unindexed=0 + ** tables, or a write to the %_content table only for =1 tables. */ + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageFindDeleteRow(tls, pStorage, iOld) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageContentInsert(tls, pStorage, int32(1), apVal, pRowid) } } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iOld, uintptr(0)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageDelete(tls, pStorage, iOld, uintptr(0), int32(1)) _fts5StorageInsert(tls, bp, pTab, apVal, pRowid) } - bUpdateOrDelete = int32(1) } } + _sqlite3Fts5StorageReleaseDeleteRow(tls, pStorage) } } } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && bUpdateOrDelete != 0 && (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete != 0 && (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion == int32(FTS5_CURRENT_VERSION) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageConfigValue(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, __ccgo_ts+36007, uintptr(0), int32(FTS5_CURRENT_VERSION_SECUREDELETE)) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = int32(FTS5_CURRENT_VERSION_SECUREDELETE) - } - } + goto update_out +update_out: + ; (*TFts5Config)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).FpzErrmsg = uintptr(0) return *(*int32)(unsafe.Pointer(bp)) } @@ -213967,8 +217244,12 @@ func _fts5SyncMethod(tls *libc.TLS, pVtab uintptr) (r int32) { // ** Implementation of xBegin() method. // */ func _fts5BeginMethod(tls *libc.TLS, pVtab uintptr) (r int32) { - _fts5NewTransaction(tls, pVtab) - return SQLITE_OK + var rc int32 + _ = rc + rc = _fts5NewTransaction(tls, pVtab) + if rc == SQLITE_OK { + } + return rc } // C documentation @@ -213995,6 +217276,7 @@ func _fts5RollbackMethod(tls *libc.TLS, pVtab uintptr) (r int32) { _, _ = pTab, rc pTab = pVtab rc = _sqlite3Fts5StorageRollback(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage) + (*TFts5Config)(unsafe.Pointer((*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig)).Fpgsz = 0 return rc } @@ -214028,12 +217310,32 @@ func _fts5ApiRowCount(tls *libc.TLS, pCtx uintptr, pnRow uintptr) (r int32) { return _sqlite3Fts5StorageRowCount(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, pnRow) } -func _fts5ApiTokenize(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pUserData uintptr, xToken uintptr) (r int32) { +// C documentation +// +// /* +// ** Implementation of xTokenize_v2() API. +// */ +func _fts5ApiTokenize_v2(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pLoc uintptr, nLoc int32, pUserData uintptr, xToken uintptr) (r int32) { var pCsr, pTab uintptr - _, _ = pCsr, pTab + var rc int32 + _, _, _ = pCsr, pTab, rc pCsr = pCtx pTab = (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab - return _sqlite3Fts5Tokenize(tls, (*TFts5Table)(unsafe.Pointer(pTab)).FpConfig, int32(FTS5_TOKENIZE_AUX), pText, nText, pUserData, xToken) + rc = SQLITE_OK + _sqlite3Fts5SetLocale(tls, (*TFts5Table)(unsafe.Pointer(pTab)).FpConfig, pLoc, nLoc) + rc = _sqlite3Fts5Tokenize(tls, (*TFts5Table)(unsafe.Pointer(pTab)).FpConfig, int32(FTS5_TOKENIZE_AUX), pText, nText, pUserData, xToken) + _sqlite3Fts5SetLocale(tls, (*TFts5Table)(unsafe.Pointer(pTab)).FpConfig, uintptr(0), 0) + return rc +} + +// C documentation +// +// /* +// ** Implementation of xTokenize() API. This is just xTokenize_v2() with NULL/0 +// ** passed as the locale. +// */ +func _fts5ApiTokenize(tls *libc.TLS, pCtx uintptr, pText uintptr, nText int32, pUserData uintptr, xToken uintptr) (r int32) { + return _fts5ApiTokenize_v2(tls, pCtx, pText, nText, uintptr(0), 0, pUserData, xToken) } func _fts5ApiPhraseCount(tls *libc.TLS, pCtx uintptr) (r int32) { @@ -214050,6 +217352,48 @@ func _fts5ApiPhraseSize(tls *libc.TLS, pCtx uintptr, iPhrase int32) (r int32) { return _sqlite3Fts5ExprPhraseSize(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, iPhrase) } +// C documentation +// +// /* +// ** Argument pStmt is an SQL statement of the type used by Fts5Cursor. This +// ** function extracts the text value of column iCol of the current row. +// ** Additionally, if there is an associated locale, it invokes +// ** sqlite3Fts5SetLocale() to configure the tokenizer. In all cases the caller +// ** should invoke sqlite3Fts5ClearLocale() to clear the locale at some point +// ** after this function returns. +// ** +// ** If successful, (*ppText) is set to point to a buffer containing the text +// ** value as utf-8 and SQLITE_OK returned. (*pnText) is set to the size of that +// ** buffer in bytes. It is not guaranteed to be nul-terminated. If an error +// ** occurs, an SQLite error code is returned. The final values of the two +// ** output parameters are undefined in this case. +// */ +func _fts5TextFromStmt(tls *libc.TLS, pConfig uintptr, pStmt uintptr, iCol int32, ppText uintptr, pnText uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var pVal uintptr + var rc int32 + var _ /* nLoc at bp+8 */ int32 + var _ /* pLoc at bp+0 */ uintptr + _, _ = pVal, rc + pVal = Xsqlite3_column_value(tls, pStmt, iCol+int32(1)) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 8)) = 0 + rc = SQLITE_OK + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_EXTERNAL) && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { + rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, ppText, pnText, bp, bp+8) + } else { + *(*uintptr)(unsafe.Pointer(ppText)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(pnText)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_column_text(tls, pStmt, iCol+int32(1)+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_column_bytes(tls, pStmt, iCol+int32(1)+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } + } + _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8))) + return rc +} + func _fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn uintptr) (r int32) { var pCsr, pTab uintptr var rc int32 @@ -214060,27 +217404,36 @@ func _fts5ApiColumnText(tls *libc.TLS, pCtx uintptr, iCol int32, pz uintptr, pn if iCol < 0 || iCol >= (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer(pTab)).FpConfig)).FnCol { rc = int32(SQLITE_RANGE) } else { - if _fts5IsContentless(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab) != 0 || (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan == int32(FTS5_PLAN_SPECIAL) { + if _fts5IsContentless(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab, 0) != 0 { *(*uintptr)(unsafe.Pointer(pz)) = uintptr(0) *(*int32)(unsafe.Pointer(pn)) = 0 } else { rc = _fts5SeekCursor(tls, pCsr, 0) if rc == SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pz)) = Xsqlite3_column_text(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol+int32(1)) - *(*int32)(unsafe.Pointer(pn)) = Xsqlite3_column_bytes(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol+int32(1)) + rc = _fts5TextFromStmt(tls, (*TFts5Table)(unsafe.Pointer(pTab)).FpConfig, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol, pz, pn) + _sqlite3Fts5ClearLocale(tls, (*TFts5Table)(unsafe.Pointer(pTab)).FpConfig) } } } return rc } +// C documentation +// +// /* +// ** This is called by various API functions - xInst, xPhraseFirst, +// ** xPhraseFirstColumn etc. - to obtain the position list for phrase iPhrase +// ** of the current row. This function works for both detail=full tables (in +// ** which case the position-list was read from the fts index) or for other +// ** detail= modes if the row content is available. +// */ func _fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var aPopulator, pConfig, pSorter uintptr var bLive, i, i1, rc, v2 int32 - var _ /* n at bp+0 */ int32 - var _ /* z at bp+8 */ uintptr + var _ /* n at bp+8 */ int32 + var _ /* z at bp+0 */ uintptr _, _, _, _, _, _, _, _ = aPopulator, bLive, i, i1, pConfig, pSorter, rc, v2 pConfig = (*TFts5Table)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig rc = SQLITE_OK @@ -214088,32 +217441,44 @@ func _fts5CsrPoslist(tls *libc.TLS, pCsr uintptr, iPhrase int32, pa uintptr, pn if iPhrase < 0 || iPhrase >= _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) { rc = int32(SQLITE_RANGE) } else { - if (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&int32(FTS5CSR_REQUIRE_POSLIST) != 0 { - if (*TFts5Config)(unsafe.Pointer(pConfig)).FeDetail != FTS5_DETAIL_FULL { - aPopulator = _sqlite3Fts5ExprClearPoslists(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, bLive) - if aPopulator == uintptr(0) { - rc = int32(SQLITE_NOMEM) - } - i = 0 - for { - if !(i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol && rc == SQLITE_OK) { - break + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeDetail != FTS5_DETAIL_FULL && _fts5IsContentless(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab, int32(1)) != 0 { + *(*uintptr)(unsafe.Pointer(pa)) = uintptr(0) + *(*int32)(unsafe.Pointer(pn)) = 0 + return SQLITE_OK + } else { + if (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fcsrflags&int32(FTS5CSR_REQUIRE_POSLIST) != 0 { + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeDetail != FTS5_DETAIL_FULL { + aPopulator = _sqlite3Fts5ExprClearPoslists(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, bLive) + if aPopulator == uintptr(0) { + rc = int32(SQLITE_NOMEM) } - rc = _fts5ApiColumnText(tls, pCsr, i, bp+8, bp) if rc == SQLITE_OK { - rc = _sqlite3Fts5ExprPopulatePoslists(tls, pConfig, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, aPopulator, i, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp))) + rc = _fts5SeekCursor(tls, pCsr, 0) + } + i = 0 + for { + if !(i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol && rc == SQLITE_OK) { + break + } + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 8)) = 0 + rc = _fts5TextFromStmt(tls, pConfig, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, i, bp, bp+8) + if rc == SQLITE_OK { + rc = _sqlite3Fts5ExprPopulatePoslists(tls, pConfig, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, aPopulator, i, *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8))) + } + _sqlite3Fts5ClearLocale(tls, pConfig) + goto _1 + _1: + ; + i++ + } + Xsqlite3_free(tls, aPopulator) + if (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 { + _sqlite3Fts5ExprCheckPoslists(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*TFts5Sorter)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid) } - goto _1 - _1: - ; - i++ - } - Xsqlite3_free(tls, aPopulator) - if (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter != 0 { - _sqlite3Fts5ExprCheckPoslists(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr, (*TFts5Sorter)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter)).FiRowid) } + *(*int32)(unsafe.Pointer(pCsr + 80)) &= ^libc.Int32FromInt32(FTS5CSR_REQUIRE_POSLIST) } - *(*int32)(unsafe.Pointer(pCsr + 80)) &= ^libc.Int32FromInt32(FTS5CSR_REQUIRE_POSLIST) } } if rc == SQLITE_OK { @@ -214218,9 +217583,9 @@ func _fts5CacheInstArray(tls *libc.TLS, pCsr uintptr) (r int32) { } aInst = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaInst + uintptr(int32(3)*(nInst-int32(1)))*4 *(*int32)(unsafe.Pointer(aInst)) = iBest - *(*int32)(unsafe.Pointer(aInst + 1*4)) = int32((*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(iBest)*32))).FiPos >> libc.Int32FromInt32(32)) + *(*int32)(unsafe.Pointer(aInst + 1*4)) = int32((*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(iBest)*32))).FiPos >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) *(*int32)(unsafe.Pointer(aInst + 2*4)) = int32((*(*TFts5PoslistReader)(unsafe.Pointer(aIter + uintptr(iBest)*32))).FiPos & libc.Int64FromInt32(0x7FFFFFFF)) - if *(*int32)(unsafe.Pointer(aInst + 1*4)) < 0 || *(*int32)(unsafe.Pointer(aInst + 1*4)) >= nCol { + if *(*int32)(unsafe.Pointer(aInst + 1*4)) >= nCol { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) break } @@ -214296,10 +217661,10 @@ func _fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr defer tls.Free(16) var i, i1, i2, rc int32 var iRowid Ti64 - var p, pConfig, pCsr, pTab uintptr + var pConfig, pCsr, pTab uintptr var _ /* n at bp+8 */ int32 var _ /* z at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _ = i, i1, i2, iRowid, p, pConfig, pCsr, pTab, rc + _, _, _, _, _, _, _, _ = i, i1, i2, iRowid, pConfig, pCsr, pTab, rc pCsr = pCtx pTab = (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab pConfig = (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig @@ -214309,7 +217674,7 @@ func _fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr iRowid = _fts5CursorRowid(tls, pCsr) rc = _sqlite3Fts5StorageDocsize(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, iRowid, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize) } else { - if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { + if !((*TFts5Config)(unsafe.Pointer(pConfig)).FzContent != 0) || (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { i = 0 for { if !(i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -214324,18 +217689,21 @@ func _fts5ApiColumnSize(tls *libc.TLS, pCtx uintptr, iCol int32, pnToken uintptr i++ } } else { + rc = _fts5SeekCursor(tls, pCsr, 0) i1 = 0 for { if !(rc == SQLITE_OK && i1 < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i1)))) == 0 { - p = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i1)*4 + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 8)) = 0 *(*int32)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize + uintptr(i1)*4)) = 0 - rc = _fts5ApiColumnText(tls, pCtx, i1, bp, bp+8) + rc = _fts5TextFromStmt(tls, pConfig, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, i1, bp, bp+8) if rc == SQLITE_OK { - rc = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_AUX), *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)), p, __ccgo_fp(_fts5ColumnSizeCb)) + rc = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_AUX), *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)), (*TFts5Cursor)(unsafe.Pointer(pCsr)).FaColumnSize+uintptr(i1)*4, __ccgo_fp(_fts5ColumnSizeCb)) } + _sqlite3Fts5ClearLocale(tls, pConfig) } goto _2 _2: @@ -214447,19 +217815,29 @@ func _fts5ApiGetAuxdata(tls *libc.TLS, pCtx uintptr, bClear int32) (r uintptr) { return pRet } -func _fts5ApiPhraseNext(tls *libc.TLS, pUnused uintptr, pIter uintptr, piCol uintptr, piOff uintptr) { +func _fts5ApiPhraseNext(tls *libc.TLS, pCtx uintptr, pIter uintptr, piCol uintptr, piOff uintptr) { bp := tls.Alloc(16) defer tls.Free(16) + var nCol, v1 int32 var _ /* iVal at bp+0 */ int32 - _ = pUnused + _, _ = nCol, v1 if (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa >= (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fb { *(*int32)(unsafe.Pointer(piCol)) = -int32(1) *(*int32)(unsafe.Pointer(piOff)) = -int32(1) } else { *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(_sqlite3Fts5GetVarint32(tls, (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp)) if *(*int32)(unsafe.Pointer(bp)) == int32(1) { + /* Avoid returning a (*piCol) value that is too large for the table, + ** even if the position-list is corrupt. The caller might not be + ** expecting it. */ + nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCtx)).Fbase.FpVtab)).FpConfig)).FnCol *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(_sqlite3Fts5GetVarint32(tls, (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp)) - *(*int32)(unsafe.Pointer(piCol)) = *(*int32)(unsafe.Pointer(bp)) + if *(*int32)(unsafe.Pointer(bp)) >= nCol { + v1 = nCol - int32(1) + } else { + v1 = *(*int32)(unsafe.Pointer(bp)) + } + *(*int32)(unsafe.Pointer(piCol)) = v1 *(*int32)(unsafe.Pointer(piOff)) = 0 *(*uintptr)(unsafe.Pointer(pIter)) += uintptr(_sqlite3Fts5GetVarint32(tls, (*TFts5PhraseIter)(unsafe.Pointer(pIter)).Fa, bp)) } @@ -214622,8 +218000,46 @@ func _fts5ApiInstToken(tls *libc.TLS, pCtx uintptr, iIdx int32, iToken int32, pp return rc } +// C documentation +// +// /* +// ** The xColumnLocale() API. +// */ +func _fts5ApiColumnLocale(tls *libc.TLS, pCtx uintptr, iCol int32, pzLocale uintptr, pnLocale uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var pConfig, pCsr uintptr + var rc int32 + var _ /* nDummy at bp+8 */ int32 + var _ /* zDummy at bp+0 */ uintptr + _, _, _ = pConfig, pCsr, rc + rc = SQLITE_OK + pCsr = pCtx + pConfig = (*TFts5Table)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FpConfig + *(*uintptr)(unsafe.Pointer(pzLocale)) = uintptr(0) + *(*int32)(unsafe.Pointer(pnLocale)) = 0 + if iCol < 0 || iCol >= (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { + rc = int32(SQLITE_RANGE) + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol)))) == 0 && 0 == _fts5IsContentless(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab, int32(1)) && (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 { + rc = _fts5SeekCursor(tls, pCsr, 0) + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 8)) = 0 + rc = _fts5TextFromStmt(tls, pConfig, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol, bp, bp+8) + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(pzLocale)) = (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale + *(*int32)(unsafe.Pointer(pnLocale)) = (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale + } + _sqlite3Fts5ClearLocale(tls, pConfig) + } + } + } + return rc +} + var _sFts5Api = TFts5ExtensionApi{ - FiVersion: int32(3), + FiVersion: int32(4), } func init() { @@ -214649,6 +218065,8 @@ func init() { *(*uintptr)(unsafe.Add(p, 152)) = __ccgo_fp(_fts5ApiPhraseNextColumn) *(*uintptr)(unsafe.Add(p, 160)) = __ccgo_fp(_fts5ApiQueryToken) *(*uintptr)(unsafe.Add(p, 168)) = __ccgo_fp(_fts5ApiInstToken) + *(*uintptr)(unsafe.Add(p, 176)) = __ccgo_fp(_fts5ApiColumnLocale) + *(*uintptr)(unsafe.Add(p, 184)) = __ccgo_fp(_fts5ApiTokenize_v2) } // C documentation @@ -214722,21 +218140,41 @@ func _fts5CursorFromCsrid(tls *libc.TLS, pGlobal uintptr, iCsrId Ti64) (r uintpt return pCsr } +// C documentation +// +// /* +// ** Parameter zFmt is a printf() style formatting string. This function +// ** formats it using the trailing arguments and returns the result as +// ** an error message to the context passed as the first argument. +// */ +func _fts5ResultError(tls *libc.TLS, pCtx uintptr, zFmt uintptr, va uintptr) { + var ap Tva_list + var zErr uintptr + _, _ = ap, zErr + zErr = uintptr(0) + ap = va + zErr = Xsqlite3_vmprintf(tls, zFmt, ap) + Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) + Xsqlite3_free(tls, zErr) + _ = ap +} + func _fts5ApiCallback(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(16) defer tls.Free(16) var iCsrId Ti64 - var pAux, pCsr, zErr uintptr - _, _, _, _ = iCsrId, pAux, pCsr, zErr + var pAux, pCsr, pTab uintptr + _, _, _, _ = iCsrId, pAux, pCsr, pTab pAux = Xsqlite3_user_data(tls, context) iCsrId = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv))) pCsr = _fts5CursorFromCsrid(tls, (*TFts5Auxiliary)(unsafe.Pointer(pAux)).FpGlobal, iCsrId) - if pCsr == uintptr(0) || (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 0 { - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+37507, libc.VaList(bp+8, iCsrId)) - Xsqlite3_result_error(tls, context, zErr, -int32(1)) - Xsqlite3_free(tls, zErr) + if pCsr == uintptr(0) || ((*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan == 0 || (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan == int32(FTS5_PLAN_SPECIAL)) { + _fts5ResultError(tls, context, __ccgo_ts+38104, libc.VaList(bp+8, iCsrId)) } else { + pTab = (*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab _fts5ApiInvoke(tls, pAux, pCsr, context, argc-int32(1), argv+1*8) + Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer(pTab)).FzErrMsg) + (*Tsqlite3_vtab)(unsafe.Pointer(pTab)).FzErrMsg = uintptr(0) } } @@ -214878,10 +218316,12 @@ _4: func _fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var pConfig, pCsr, pTab, zErr uintptr + var pConfig, pCsr, pTab, pVal uintptr var rc, v1 int32 var v2 bool - _, _, _, _, _, _, _ = pConfig, pCsr, pTab, rc, zErr, v1, v2 + var _ /* n at bp+8 */ int32 + var _ /* z at bp+0 */ uintptr + _, _, _, _, _, _, _ = pConfig, pCsr, pTab, pVal, rc, v1, v2 pTab = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab pConfig = (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpConfig pCsr = pCursor @@ -214914,19 +218354,24 @@ func _fts5ColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol int32) } } } else { - if !(_fts5IsContentless(tls, pTab) != 0) { + if !(Xsqlite3_vtab_nochange(tls, pCtx) != 0) && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != int32(FTS5_CONTENT_NONE) { (*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = pTab + 16 rc = _fts5SeekCursor(tls, pCsr, int32(1)) if rc == SQLITE_OK { - Xsqlite3_result_value(tls, pCtx, Xsqlite3_column_value(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol+int32(1))) + pVal = Xsqlite3_column_value(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol+int32(1)) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_EXTERNAL) && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 8)) = 0 + rc = _fts5TextFromStmt(tls, pConfig, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt, iCol, bp, bp+8) + if rc == SQLITE_OK { + Xsqlite3_result_text(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 8)), uintptr(-libc.Int32FromInt32(1))) + } + _sqlite3Fts5ClearLocale(tls, pConfig) + } else { + Xsqlite3_result_value(tls, pCtx, pVal) + } } (*TFts5Config)(unsafe.Pointer(pConfig)).FpzErrmsg = uintptr(0) - } else { - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 && Xsqlite3_vtab_nochange(tls, pCtx) != 0 { - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+37528, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) - Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) - Xsqlite3_free(tls, zErr) - } } } } @@ -215073,37 +218518,215 @@ func _fts5CreateAux(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintpt // C documentation // // /* -// ** Register a new tokenizer. This is the implementation of the -// ** fts5_api.xCreateTokenizer() method. +// ** This function is used by xCreateTokenizer_v2() and xCreateTokenizer(). +// ** It allocates and partially populates a new Fts5TokenizerModule object. +// ** The new object is already linked into the Fts5Global context before +// ** returning. +// ** +// ** If successful, SQLITE_OK is returned and a pointer to the new +// ** Fts5TokenizerModule object returned via output parameter (*ppNew). All +// ** that is required is for the caller to fill in the methods in +// ** Fts5TokenizerModule.x1 and x2, and to set Fts5TokenizerModule.bV2Native +// ** as appropriate. +// ** +// ** If an error occurs, an SQLite error code is returned and the final value +// ** of (*ppNew) undefined. // */ -func _fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) (r int32) { +func _fts5NewTokenizerModule(tls *libc.TLS, pGlobal uintptr, zName uintptr, pUserData uintptr, xDestroy uintptr, ppNew uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) var nByte, nName Tsqlite3_int64 - var pGlobal, pNew uintptr - var rc int32 - _, _, _, _, _ = nByte, nName, pGlobal, pNew, rc - pGlobal = pApi /* Bytes of space to allocate */ - rc = SQLITE_OK + var pNew, v1 uintptr + var _ /* rc at bp+0 */ int32 + _, _, _, _ = nByte, nName, pNew, v1 + *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK /* Bytes of space to allocate */ nName = libc.Int64FromUint64(libc.Xstrlen(tls, zName) + uint64(1)) - nByte = libc.Int64FromUint64(uint64(56) + libc.Uint64FromInt64(nName)) - pNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) + nByte = libc.Int64FromUint64(uint64(96) + libc.Uint64FromInt64(nName)) + v1 = _sqlite3Fts5MallocZero(tls, bp, nByte) + pNew = v1 + *(*uintptr)(unsafe.Pointer(ppNew)) = v1 if pNew != 0 { - libc.Xmemset(tls, pNew, 0, libc.Uint64FromInt64(nByte)) - (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FzName = pNew + 1*56 + (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FzName = pNew + 1*96 libc.Xmemcpy(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FzName, zName, libc.Uint64FromInt64(nName)) (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FpUserData = pUserData - (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).Fx = *(*Tfts5_tokenizer)(unsafe.Pointer(pTokenizer)) (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FxDestroy = xDestroy (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FpNext = (*TFts5Global)(unsafe.Pointer(pGlobal)).FpTok (*TFts5Global)(unsafe.Pointer(pGlobal)).FpTok = pNew if (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FpNext == uintptr(0) { (*TFts5Global)(unsafe.Pointer(pGlobal)).FpDfltTok = pNew } + } + return *(*int32)(unsafe.Pointer(bp)) +} + +// C documentation +// +// /* +// ** An instance of this type is used as the Fts5Tokenizer object for +// ** wrapper tokenizers - those that provide access to a v1 tokenizer via +// ** the fts5_tokenizer_v2 API, and those that provide access to a v2 tokenizer +// ** via the fts5_tokenizer API. +// */ +type TFts5VtoVTokenizer = struct { + FbV2Native int32 + Fx1 Tfts5_tokenizer + Fx2 Tfts5_tokenizer_v2 + FpReal uintptr +} + +type Fts5VtoVTokenizer = TFts5VtoVTokenizer + +type TFts5VtoVTokenizer1 = struct { + FbV2Native int32 + Fx1 Tfts5_tokenizer + Fx2 Tfts5_tokenizer_v2 + FpReal uintptr +} + +type Fts5VtoVTokenizer1 = TFts5VtoVTokenizer1 + +// C documentation +// +// /* +// ** Create a wrapper tokenizer. The context argument pCtx points to the +// ** Fts5TokenizerModule object. +// */ +func _fts5VtoVCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var pMod, pNew uintptr + var _ /* rc at bp+0 */ int32 + _, _ = pMod, pNew + pMod = pCtx + pNew = uintptr(0) + *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK + pNew = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { + (*TFts5VtoVTokenizer)(unsafe.Pointer(pNew)).Fx1 = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx1 + (*TFts5VtoVTokenizer)(unsafe.Pointer(pNew)).Fx2 = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx2 + (*TFts5VtoVTokenizer)(unsafe.Pointer(pNew)).FbV2Native = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FbV2Native + if (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FbV2Native != 0 { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx2.FxCreate})))(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, azArg, nArg, pNew+64) + } else { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx1.FxCreate})))(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, azArg, nArg, pNew+64) + } + if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { + Xsqlite3_free(tls, pNew) + pNew = uintptr(0) + } + } + *(*uintptr)(unsafe.Pointer(ppOut)) = pNew + return *(*int32)(unsafe.Pointer(bp)) +} + +// C documentation +// +// /* +// ** Delete an Fts5VtoVTokenizer wrapper tokenizer. +// */ +func _fts5VtoVDelete(tls *libc.TLS, pTok uintptr) { + var p uintptr + _ = p + p = pTok + if p != 0 { + if (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FbV2Native != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx2.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal) + } else { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx1.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal) + } + Xsqlite3_free(tls, p) + } +} + +// C documentation +// +// /* +// ** xTokenizer method for a wrapper tokenizer that offers the v1 interface +// ** (no support for locales). +// */ +func _fts5V1toV2Tokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { + var p uintptr + _ = p + p = pTok + return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx2.FxTokenize})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal, pCtx, flags, pText, nText, uintptr(0), 0, xToken) +} + +// C documentation +// +// /* +// ** xTokenizer method for a wrapper tokenizer that offers the v2 interface +// ** (with locale support). +// */ +func _fts5V2toV1Tokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLocale uintptr, nLocale int32, xToken uintptr) (r int32) { + var p uintptr + _ = p + p = pTok + _ = pLocale + _ = nLocale + return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx1.FxTokenize})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal, pCtx, flags, pText, nText, xToken) +} + +// C documentation +// +// /* +// ** Register a new tokenizer. This is the implementation of the +// ** fts5_api.xCreateTokenizer_v2() method. +// */ +func _fts5CreateTokenizer_v2(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var pGlobal uintptr + var rc int32 + var _ /* pNew at bp+0 */ uintptr + _, _ = pGlobal, rc + pGlobal = pApi + rc = SQLITE_OK + if (*Tfts5_tokenizer_v2)(unsafe.Pointer(pTokenizer)).FiVersion > int32(2) { + rc = int32(SQLITE_ERROR) } else { - rc = int32(SQLITE_NOMEM) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + rc = _fts5NewTokenizerModule(tls, pGlobal, zName, pUserData, xDestroy, bp) + if *(*uintptr)(unsafe.Pointer(bp)) != 0 { + (*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx2 = *(*Tfts5_tokenizer_v2)(unsafe.Pointer(pTokenizer)) + (*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FbV2Native = int32(1) + (*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx1.FxCreate = __ccgo_fp(_fts5VtoVCreate) + (*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx1.FxTokenize = __ccgo_fp(_fts5V1toV2Tokenize) + (*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx1.FxDelete = __ccgo_fp(_fts5VtoVDelete) + } + } + return rc +} + +// C documentation +// +// /* +// ** The fts5_api.xCreateTokenizer() method. +// */ +func _fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var rc int32 + var _ /* pNew at bp+0 */ uintptr + _ = rc + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + rc = SQLITE_OK + rc = _fts5NewTokenizerModule(tls, pApi, zName, pUserData, xDestroy, bp) + if *(*uintptr)(unsafe.Pointer(bp)) != 0 { + (*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx1 = *(*Tfts5_tokenizer)(unsafe.Pointer(pTokenizer)) + (*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx2.FxCreate = __ccgo_fp(_fts5VtoVCreate) + (*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx2.FxTokenize = __ccgo_fp(_fts5V2toV1Tokenize) + (*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx2.FxDelete = __ccgo_fp(_fts5VtoVDelete) } return rc } +// C documentation +// +// /* +// ** Search the global context passed as the first argument for a tokenizer +// ** module named zName. If found, return a pointer to the Fts5TokenizerModule +// ** object. Otherwise, return NULL. +// */ func _fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) (r uintptr) { var pMod uintptr _ = pMod @@ -215132,6 +218755,33 @@ func _fts5LocateTokenizer(tls *libc.TLS, pGlobal uintptr, zName uintptr) (r uint // // /* // ** Find a tokenizer. This is the implementation of the +// ** fts5_api.xFindTokenizer_v2() method. +// */ +func _fts5FindTokenizer_v2(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData uintptr, ppTokenizer uintptr) (r int32) { + var pMod uintptr + var rc int32 + _, _ = pMod, rc + rc = SQLITE_OK + pMod = _fts5LocateTokenizer(tls, pApi, zName) + if pMod != 0 { + if (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FbV2Native != 0 { + *(*uintptr)(unsafe.Pointer(ppUserData)) = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData + } else { + *(*uintptr)(unsafe.Pointer(ppUserData)) = pMod + } + *(*uintptr)(unsafe.Pointer(ppTokenizer)) = pMod + 48 + } else { + *(*uintptr)(unsafe.Pointer(ppTokenizer)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(ppUserData)) = uintptr(0) + rc = int32(SQLITE_ERROR) + } + return rc +} + +// C documentation +// +// /* +// ** 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) (r int32) { @@ -215141,34 +218791,53 @@ func _fts5FindTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, ppUserData u rc = SQLITE_OK pMod = _fts5LocateTokenizer(tls, pApi, zName) if pMod != 0 { - *(*Tfts5_tokenizer)(unsafe.Pointer(pTokenizer)) = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx - *(*uintptr)(unsafe.Pointer(ppUserData)) = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData + if (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FbV2Native == 0 { + *(*uintptr)(unsafe.Pointer(ppUserData)) = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData + } else { + *(*uintptr)(unsafe.Pointer(ppUserData)) = pMod + } + *(*Tfts5_tokenizer)(unsafe.Pointer(pTokenizer)) = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx1 } else { libc.Xmemset(tls, pTokenizer, 0, uint64(24)) + *(*uintptr)(unsafe.Pointer(ppUserData)) = uintptr(0) rc = int32(SQLITE_ERROR) } return rc } -func _sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nArg int32, pConfig uintptr, pzErr uintptr) (r int32) { +// C documentation +// +// /* +// ** Attempt to instantiate the tokenizer. +// */ +func _sqlite3Fts5LoadTokenizer(tls *libc.TLS, pConfig uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var pMod, v1, v2 uintptr - var rc, v3 int32 - _, _, _, _, _ = pMod, rc, v1, v2, v3 + var azArg, pMod, xCreate, v1, v2 uintptr + var nArg, rc, v3 int32 + _, _, _, _, _, _, _, _ = azArg, nArg, pMod, rc, xCreate, v1, v2, v3 + azArg = (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg + nArg = (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnArg + pMod = uintptr(0) rc = SQLITE_OK if nArg == 0 { v1 = uintptr(0) } else { v1 = *(*uintptr)(unsafe.Pointer(azArg)) } - pMod = _fts5LocateTokenizer(tls, pGlobal, v1) + pMod = _fts5LocateTokenizer(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).FpGlobal, v1) if pMod == uintptr(0) { rc = int32(SQLITE_ERROR) - if pzErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37599, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg)))) - } + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+38125, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azArg)))) } else { + xCreate = uintptr(0) + if (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FbV2Native != 0 { + xCreate = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx2.FxCreate + (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2 = pMod + 48 + } else { + (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 = pMod + 24 + xCreate = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx1.FxCreate + } if azArg != 0 { v2 = azArg + 1*8 } else { @@ -215179,23 +218848,32 @@ func _sqlite3Fts5GetTokenizer(tls *libc.TLS, pGlobal uintptr, azArg uintptr, nAr } else { v3 = 0 } - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx.FxCreate})))(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, v2, v3, pConfig+112) - (*TFts5Config)(unsafe.Pointer(pConfig)).FpTokApi = pMod + 16 + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCreate})))(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, v2, v3, pConfig+128) if rc != SQLITE_OK { - if pzErr != 0 && rc != int32(SQLITE_NOMEM) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37621, 0) + if rc != int32(SQLITE_NOMEM) { + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+38147, 0) } } else { - (*TFts5Config)(unsafe.Pointer(pConfig)).FePattern = _sqlite3Fts5TokenizerPattern(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx.FxCreate, (*TFts5Config)(unsafe.Pointer(pConfig)).FpTok) + if (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FbV2Native == 0 { + (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FePattern = _sqlite3Fts5TokenizerPattern(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx1.FxCreate, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok) + } } } if rc != SQLITE_OK { - (*TFts5Config)(unsafe.Pointer(pConfig)).FpTokApi = uintptr(0) - (*TFts5Config)(unsafe.Pointer(pConfig)).FpTok = uintptr(0) + (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 = uintptr(0) + (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2 = uintptr(0) + (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok = uintptr(0) } return rc } +// C documentation +// +// /* +// ** xDestroy callback passed to sqlite3_create_module(). This is invoked +// ** when the db handle is being closed. Free memory associated with +// ** tokenizers and aux functions registered with this db handle. +// */ func _fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { var pAux, pGlobal, pNextAux, pNextTok, pTok uintptr _, _, _, _, _ = pAux, pGlobal, pNextAux, pNextTok, pTok @@ -215233,12 +218911,18 @@ func _fts5ModuleDestroy(tls *libc.TLS, pCtx uintptr) { Xsqlite3_free(tls, pGlobal) } +// C documentation +// +// /* +// ** Implementation of the fts5() function used by clients to obtain the +// ** API pointer. +// */ func _fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { var pGlobal, ppApi uintptr _, _ = pGlobal, ppApi pGlobal = Xsqlite3_user_data(tls, pCtx) _ = nArg - ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), __ccgo_ts+37652) + ppApi = Xsqlite3_value_pointer(tls, *(*uintptr)(unsafe.Pointer(apArg)), __ccgo_ts+38178) if ppApi != 0 { *(*uintptr)(unsafe.Pointer(ppApi)) = pGlobal } @@ -215252,7 +218936,75 @@ func _fts5Fts5Func(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { func _fts5SourceIdFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apUnused uintptr) { _ = nArg _ = apUnused - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+37665, -int32(1), uintptr(-libc.Int32FromInt32(1))) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+38191, -int32(1), uintptr(-libc.Int32FromInt32(1))) +} + +// C documentation +// +// /* +// ** Implementation of fts5_locale(LOCALE, TEXT) function. +// ** +// ** If parameter LOCALE is NULL, or a zero-length string, then a copy of +// ** TEXT is returned. Otherwise, both LOCALE and TEXT are interpreted as +// ** text, and the value returned is a blob consisting of: +// ** +// ** * The 4 bytes 0x00, 0xE0, 0xB2, 0xEb (FTS5_LOCALE_HEADER). +// ** * The LOCALE, as utf-8 text, followed by +// ** * 0x00, followed by +// ** * The TEXT, as utf-8 text. +// ** +// ** There is no final nul-terminator following the TEXT value. +// */ +func _fts5LocaleFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { + var nBlob, nLocale, nText int32 + var p, pBlob, pCsr, zLocale, zText, v1 uintptr + _, _, _, _, _, _, _, _, _ = nBlob, nLocale, nText, p, pBlob, pCsr, zLocale, zText, v1 + zLocale = uintptr(0) + nLocale = 0 + zText = uintptr(0) + nText = 0 + _ = nArg + zLocale = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) + nLocale = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) + zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) + nText = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) + if zLocale == uintptr(0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zLocale))) == int32('\000') { + Xsqlite3_result_text(tls, pCtx, zText, nText, uintptr(-libc.Int32FromInt32(1))) + } else { + p = Xsqlite3_user_data(tls, pCtx) + pBlob = uintptr(0) + pCsr = uintptr(0) + nBlob = 0 + nBlob = libc.Int32FromInt64(16) + nLocale + int32(1) + nText + pBlob = Xsqlite3_malloc(tls, nBlob) + if pBlob == uintptr(0) { + Xsqlite3_result_error_nomem(tls, pCtx) + return + } + pCsr = pBlob + libc.Xmemcpy(tls, pCsr, p+96, libc.Uint64FromInt32(libc.Int32FromInt64(16))) + pCsr += uintptr(libc.Int32FromInt64(16)) + libc.Xmemcpy(tls, pCsr, zLocale, libc.Uint64FromInt32(nLocale)) + pCsr += uintptr(nLocale) + v1 = pCsr + pCsr++ + *(*Tu8)(unsafe.Pointer(v1)) = uint8(0x00) + if zText != 0 { + libc.Xmemcpy(tls, pCsr, zText, libc.Uint64FromInt32(nText)) + } + Xsqlite3_result_blob(tls, pCtx, pBlob, nBlob, __ccgo_fp(Xsqlite3_free)) + } +} + +// C documentation +// +// /* +// ** Implementation of fts5_insttoken() function. +// */ +func _fts5InsttokenFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { + _ = nArg + Xsqlite3_result_value(tls, pCtx, *(*uintptr)(unsafe.Pointer(apArg))) + Xsqlite3_result_subtype(tls, pCtx, uint32(FTS5_INSTTOKEN_SUBTYPE)) } // C documentation @@ -215281,11 +219033,11 @@ func _fts5ShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName2 = [5]uintptr{ - 0: __ccgo_ts + 37756, - 1: __ccgo_ts + 35268, - 2: __ccgo_ts + 25916, - 3: __ccgo_ts + 35835, - 4: __ccgo_ts + 11918, + 0: __ccgo_ts + 38282, + 1: __ccgo_ts + 35493, + 2: __ccgo_ts + 25999, + 3: __ccgo_ts + 36188, + 4: __ccgo_ts + 11980, } // C documentation @@ -215307,7 +219059,7 @@ func _fts5IntegrityMethod(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zTabnam rc = _sqlite3Fts5StorageIntegrity(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).FpStorage, 0) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) && rc != SQLITE_OK { if rc&int32(0xff) == int32(SQLITE_CORRUPT) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37763, libc.VaList(bp+8, zSchema, zTabname)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+38289, libc.VaList(bp+8, zSchema, zTabname)) if *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { v1 = SQLITE_OK } else { @@ -215315,7 +219067,7 @@ func _fts5IntegrityMethod(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zTabnam } rc = v1 } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37809, libc.VaList(bp+8, zSchema, zTabname, Xsqlite3_errstr(tls, rc))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+38335, libc.VaList(bp+8, zSchema, zTabname, Xsqlite3_errstr(tls, rc))) } } _sqlite3Fts5IndexCloseReader(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex) @@ -215328,18 +219080,27 @@ func _fts5Init(tls *libc.TLS, db uintptr) (r int32) { var rc int32 _, _, _ = p, pGlobal, rc pGlobal = uintptr(0) - pGlobal = Xsqlite3_malloc(tls, int32(80)) + pGlobal = Xsqlite3_malloc(tls, int32(112)) if pGlobal == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p = pGlobal - libc.Xmemset(tls, pGlobal, 0, uint64(80)) + libc.Xmemset(tls, pGlobal, 0, uint64(112)) (*TFts5Global)(unsafe.Pointer(pGlobal)).Fdb = db - (*TFts5Global)(unsafe.Pointer(pGlobal)).Fapi.FiVersion = int32(2) + (*TFts5Global)(unsafe.Pointer(pGlobal)).Fapi.FiVersion = int32(3) (*TFts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxCreateFunction = __ccgo_fp(_fts5CreateAux) (*TFts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxCreateTokenizer = __ccgo_fp(_fts5CreateTokenizer) (*TFts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxFindTokenizer = __ccgo_fp(_fts5FindTokenizer) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+37872, uintptr(unsafe.Pointer(&_fts5Mod)), p, __ccgo_fp(_fts5ModuleDestroy)) + (*TFts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxCreateTokenizer_v2 = __ccgo_fp(_fts5CreateTokenizer_v2) + (*TFts5Global)(unsafe.Pointer(pGlobal)).Fapi.FxFindTokenizer_v2 = __ccgo_fp(_fts5FindTokenizer_v2) + /* Initialize pGlobal->aLocaleHdr[] to a 128-bit pseudo-random vector. + ** The constants below were generated randomly. */ + Xsqlite3_randomness(tls, int32(16), pGlobal+96) + *(*Tu32)(unsafe.Pointer(pGlobal + 96)) ^= uint32(0xF924976D) + *(*Tu32)(unsafe.Pointer(pGlobal + 96 + 1*4)) ^= uint32(0x16596E13) + *(*Tu32)(unsafe.Pointer(pGlobal + 96 + 2*4)) ^= uint32(0x7C80BEAA) + *(*Tu32)(unsafe.Pointer(pGlobal + 96 + 3*4)) ^= uint32(0x9B03A67F) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+38398, uintptr(unsafe.Pointer(&_fts5Mod)), p, __ccgo_fp(_fts5ModuleDestroy)) if rc == SQLITE_OK { rc = _sqlite3Fts5IndexInit(tls, db) } @@ -215356,10 +219117,16 @@ func _fts5Init(tls *libc.TLS, db uintptr) (r int32) { rc = _sqlite3Fts5VocabInit(tls, pGlobal, db) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+37872, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_fts5Fts5Func), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+38398, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_fts5Fts5Func), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+37877, 0, libc.Int32FromInt32(SQLITE_UTF8)|libc.Int32FromInt32(SQLITE_DETERMINISTIC)|libc.Int32FromInt32(SQLITE_INNOCUOUS), p, __ccgo_fp(_fts5SourceIdFunc), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+38403, 0, libc.Int32FromInt32(SQLITE_UTF8)|libc.Int32FromInt32(SQLITE_DETERMINISTIC)|libc.Int32FromInt32(SQLITE_INNOCUOUS), p, __ccgo_fp(_fts5SourceIdFunc), uintptr(0), uintptr(0)) + } + if rc == SQLITE_OK { + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+38418, int32(2), libc.Int32FromInt32(SQLITE_UTF8)|libc.Int32FromInt32(SQLITE_INNOCUOUS)|libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)|libc.Int32FromInt32(SQLITE_SUBTYPE), p, __ccgo_fp(_fts5LocaleFunc), uintptr(0), uintptr(0)) + } + if rc == SQLITE_OK { + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+38430, int32(1), libc.Int32FromInt32(SQLITE_UTF8)|libc.Int32FromInt32(SQLITE_INNOCUOUS)|libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE), p, __ccgo_fp(_fts5InsttokenFunc), uintptr(0), uintptr(0)) } } /* If SQLITE_FTS5_ENABLE_TEST_MI is defined, assume that the file @@ -215431,13 +219198,40 @@ func _sqlite3Fts5Init(tls *libc.TLS, db uintptr) (r int32) { /* #include "fts5Int.h" */ +/* +** pSavedRow: +** SQL statement FTS5_STMT_LOOKUP2 is a copy of FTS5_STMT_LOOKUP, it +** does a by-rowid lookup to retrieve a single row from the %_content +** table or equivalent external-content table/view. +** +** However, FTS5_STMT_LOOKUP2 is only used when retrieving the original +** values for a row being UPDATEd. In that case, the SQL statement is +** not reset and pSavedRow is set to point at it. This is so that the +** insert operation that follows the delete may access the original +** row values for any new values for which sqlite3_value_nochange() returns +** true. i.e. if the user executes: +** +** CREATE VIRTUAL TABLE ft USING fts5(a, b, c, locale=1); +** ... +** UPDATE fts SET a=?, b=? WHERE rowid=?; +** +** then the value passed to the xUpdate() method of this table as the +** new.c value is an sqlite3_value_nochange() value. So in this case it +** must be read from the saved row stored in Fts5Storage.pSavedRow. +** +** This is necessary - using sqlite3_value_nochange() instead of just having +** SQLite pass the original value back via xUpdate() - so as not to discard +** any locale information associated with such values. +** + */ type TFts5Storage1 = struct { FpConfig uintptr FpIndex uintptr FbTotalsValid int32 FnTotalRow Ti64 FaTotalSize uintptr - FaStmt [11]uintptr + FpSavedRow uintptr + FaStmt [12]uintptr } type Fts5Storage1 = TFts5Storage1 @@ -215451,99 +219245,131 @@ type Fts5Storage1 = TFts5Storage1 // ** occurs. // */ func _fts5StorageGetStmt(tls *libc.TLS, p uintptr, eStmt int32, ppStmt uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) - var azStmt [11]uintptr - var f, i, nCol, rc int32 - var pC, zBind, zSql, v2, v3 uintptr - _, _, _, _, _, _, _, _, _, _ = azStmt, f, i, nCol, pC, rc, zBind, zSql, v2, v3 - rc = SQLITE_OK + bp := tls.Alloc(64) + defer tls.Free(64) + var azStmt [12]uintptr + var f, i int32 + var pC, zBind, zSql, v2, v4, v5 uintptr + var _ /* rc at bp+0 */ int32 + _, _, _, _, _, _, _, _, _ = azStmt, f, i, pC, zBind, zSql, v2, v4, v5 + *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK /* If there is no %_docsize table, there should be no requests for ** statements to operate on it. */ - if *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(eStmt)*8)) == uintptr(0) { - azStmt = [11]uintptr{ - 0: __ccgo_ts + 37892, - 1: __ccgo_ts + 37960, - 2: __ccgo_ts + 38029, - 3: __ccgo_ts + 38062, - 4: __ccgo_ts + 38101, - 5: __ccgo_ts + 38141, - 6: __ccgo_ts + 38180, - 7: __ccgo_ts + 38223, - 8: __ccgo_ts + 38262, - 9: __ccgo_ts + 38306, - 10: __ccgo_ts + 38346, + if *(*uintptr)(unsafe.Pointer(p + 48 + uintptr(eStmt)*8)) == uintptr(0) { + azStmt = [12]uintptr{ + 0: __ccgo_ts + 38445, + 1: __ccgo_ts + 38513, + 2: __ccgo_ts + 38582, + 3: __ccgo_ts + 38582, + 4: __ccgo_ts + 38615, + 5: __ccgo_ts + 38654, + 6: __ccgo_ts + 38694, + 7: __ccgo_ts + 38733, + 8: __ccgo_ts + 38776, + 9: __ccgo_ts + 38815, + 10: __ccgo_ts + 38859, + 11: __ccgo_ts + 38899, } pC = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig zSql = uintptr(0) switch eStmt { case int32(FTS5_STMT_SCAN): - zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pC)).FzContentExprlist, (*TFts5Config)(unsafe.Pointer(pC)).FzContent)) + zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pC)).FzContentExprlist, (*TFts5Config)(unsafe.Pointer(pC)).FzContent)) case FTS5_STMT_SCAN_ASC: fallthrough case int32(FTS5_STMT_SCAN_DESC): - zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pC)).FzContentExprlist, (*TFts5Config)(unsafe.Pointer(pC)).FzContent, (*TFts5Config)(unsafe.Pointer(pC)).FzContentRowid, (*TFts5Config)(unsafe.Pointer(pC)).FzContentRowid, (*TFts5Config)(unsafe.Pointer(pC)).FzContentRowid)) + zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pC)).FzContentExprlist, (*TFts5Config)(unsafe.Pointer(pC)).FzContent, (*TFts5Config)(unsafe.Pointer(pC)).FzContentRowid, (*TFts5Config)(unsafe.Pointer(pC)).FzContentRowid, (*TFts5Config)(unsafe.Pointer(pC)).FzContentRowid)) case int32(FTS5_STMT_LOOKUP): - zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pC)).FzContentExprlist, (*TFts5Config)(unsafe.Pointer(pC)).FzContent, (*TFts5Config)(unsafe.Pointer(pC)).FzContentRowid)) + fallthrough + case int32(FTS5_STMT_LOOKUP2): + zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pC)).FzContentExprlist, (*TFts5Config)(unsafe.Pointer(pC)).FzContent, (*TFts5Config)(unsafe.Pointer(pC)).FzContentRowid)) case int32(FTS5_STMT_INSERT_CONTENT): fallthrough case int32(FTS5_STMT_REPLACE_CONTENT): - nCol = (*TFts5Config)(unsafe.Pointer(pC)).FnCol + int32(1) - zBind = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(int32(1)+nCol*int32(2))) - if zBind != 0 { + zBind = uintptr(0) + /* Add bindings for the "c*" columns - those that store the actual + ** table content. If eContent==NORMAL, then there is one binding + ** for each column. Or, if eContent==UNINDEXED, then there are only + ** bindings for the UNINDEXED columns. */ + i = 0 + for { + if !(*(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && i < (*TFts5Config)(unsafe.Pointer(pC)).FnCol+int32(1)) { + break + } + if !(i != 0) || (*TFts5Config)(unsafe.Pointer(pC)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pC)).FabUnindexed + uintptr(i-int32(1)))) != 0 { + if zBind != 0 { + v2 = __ccgo_ts + 13277 + } else { + v2 = __ccgo_ts + 1663 + } + zBind = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38922, libc.VaList(bp+16, zBind, v2, i+int32(1))) + } + goto _1 + _1: + ; + i++ + } + /* Add bindings for any "l*" columns. Only non-UNINDEXED columns + ** require these. */ + if (*TFts5Config)(unsafe.Pointer(pC)).FbLocale != 0 && (*TFts5Config)(unsafe.Pointer(pC)).FeContent == FTS5_CONTENT_NORMAL { i = 0 for { - if !(i < nCol) { + if !(*(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && i < (*TFts5Config)(unsafe.Pointer(pC)).FnCol) { break } - *(*uint8)(unsafe.Pointer(zBind + uintptr(i*int32(2)))) = uint8('?') - *(*uint8)(unsafe.Pointer(zBind + uintptr(i*int32(2)+int32(1)))) = uint8(',') - goto _1 - _1: + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pC)).FabUnindexed + uintptr(i)))) == 0 { + zBind = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38930, libc.VaList(bp+16, zBind, (*TFts5Config)(unsafe.Pointer(pC)).FnCol+i+int32(2))) + } + goto _3 + _3: ; i++ } - *(*uint8)(unsafe.Pointer(zBind + uintptr(i*int32(2)-int32(1)))) = uint8('\000') - zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pC)).FzDb, (*TFts5Config)(unsafe.Pointer(pC)).FzName, zBind)) - Xsqlite3_free(tls, zBind) } + zSql = _sqlite3Fts5Mprintf(tls, bp, azStmt[eStmt], libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pC)).FzDb, (*TFts5Config)(unsafe.Pointer(pC)).FzName, zBind)) + Xsqlite3_free(tls, zBind) case int32(FTS5_STMT_REPLACE_DOCSIZE): if (*TFts5Config)(unsafe.Pointer(pC)).FbContentlessDelete != 0 { - v2 = __ccgo_ts + 38369 + v4 = __ccgo_ts + 38937 } else { - v2 = __ccgo_ts + 1662 + v4 = __ccgo_ts + 1663 } - zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pC)).FzDb, (*TFts5Config)(unsafe.Pointer(pC)).FzName, v2)) + zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pC)).FzDb, (*TFts5Config)(unsafe.Pointer(pC)).FzName, v4)) case int32(FTS5_STMT_LOOKUP_DOCSIZE): if (*TFts5Config)(unsafe.Pointer(pC)).FbContentlessDelete != 0 { - v3 = __ccgo_ts + 38372 + v5 = __ccgo_ts + 38940 } else { - v3 = __ccgo_ts + 1662 + v5 = __ccgo_ts + 1663 } - zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+8, v3, (*TFts5Config)(unsafe.Pointer(pC)).FzDb, (*TFts5Config)(unsafe.Pointer(pC)).FzName)) + zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+16, v5, (*TFts5Config)(unsafe.Pointer(pC)).FzDb, (*TFts5Config)(unsafe.Pointer(pC)).FzName)) default: - zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pC)).FzDb, (*TFts5Config)(unsafe.Pointer(pC)).FzName)) + zSql = Xsqlite3_mprintf(tls, azStmt[eStmt], libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pC)).FzDb, (*TFts5Config)(unsafe.Pointer(pC)).FzName)) break } if zSql == uintptr(0) { - rc = int32(SQLITE_NOMEM) + *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { f = int32(SQLITE_PREPARE_PERSISTENT) - if eStmt > int32(FTS5_STMT_LOOKUP) { + if eStmt > int32(FTS5_STMT_LOOKUP2) { f |= int32(SQLITE_PREPARE_NO_VTAB) } (*TFts5Config)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock++ - rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pC)).Fdb, zSql, -int32(1), libc.Uint32FromInt32(f), p+40+uintptr(eStmt)*8, uintptr(0)) + *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pC)).Fdb, zSql, -int32(1), libc.Uint32FromInt32(f), p+48+uintptr(eStmt)*8, uintptr(0)) (*TFts5Config)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FpConfig)).FbLock-- Xsqlite3_free(tls, zSql) - if rc != SQLITE_OK && pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3859, libc.VaList(bp+8, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pC)).Fdb))) + if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK && pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pC)).Fdb))) + } + if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) && eStmt > int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { + /* One of the internal tables - not the %_content table - is missing. + ** This counts as a corrupted table. */ + *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_CORRUPT) } } } - *(*uintptr)(unsafe.Pointer(ppStmt)) = *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(eStmt)*8)) + *(*uintptr)(unsafe.Pointer(ppStmt)) = *(*uintptr)(unsafe.Pointer(p + 48 + uintptr(eStmt)*8)) Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(ppStmt))) - return rc + return *(*int32)(unsafe.Pointer(bp)) } func _fts5ExecPrintf(tls *libc.TLS, db uintptr, pzErr uintptr, zFormat uintptr, va uintptr) (r int32) { @@ -215574,12 +219400,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38380, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38948, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38484, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39052, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38522, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39090, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -215588,7 +219414,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38560, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39128, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -215600,14 +219426,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+25916, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11918, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37756, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+25999, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11980, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38282, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35835, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36188, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35268, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35493, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -215627,13 +219453,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30556 + v1 = __ccgo_ts + 30639 } else { - v1 = __ccgo_ts + 1662 + v1 = __ccgo_ts + 1663 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+38602, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39170, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+38632, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39200, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -215656,7 +219482,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr var p, zCols, zDefn, v1 uintptr _, _, _, _, _, _, _, _, _ = i, iOff, nByte, nDefn, p, rc, zCols, zDefn, v1 rc = SQLITE_OK /* Bytes of space to allocate */ - nByte = libc.Int64FromUint64(uint64(128) + libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*uint64(8)) /* Fts5Storage.aTotalSize[] */ + nByte = libc.Int64FromUint64(uint64(144) + libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*uint64(8)) /* Fts5Storage.aTotalSize[] */ v1 = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) p = v1 *(*uintptr)(unsafe.Pointer(pp)) = v1 @@ -215664,46 +219490,64 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr return int32(SQLITE_NOMEM) } libc.Xmemset(tls, p, 0, libc.Uint64FromInt64(nByte)) - (*TFts5Storage)(unsafe.Pointer(p)).FaTotalSize = p + 1*128 + (*TFts5Storage)(unsafe.Pointer(p)).FaTotalSize = p + 1*144 (*TFts5Storage)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Storage)(unsafe.Pointer(p)).FpIndex = pIndex if bCreate != 0 { - if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { nDefn = int32(32) + (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol*int32(10) - zDefn = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(int64(32)+int64((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*int64(10))) + zDefn = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(int64(32)+int64((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*int64(20))) if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+38676, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39244, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { if !(i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+38699, libc.VaList(bp+8, i)) - iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39267, libc.VaList(bp+8, i)) + iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) + } goto _2 _2: ; i++ } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35268, zDefn, 0, pzErr) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 { + i = 0 + for { + if !(i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { + break + } + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39273, libc.VaList(bp+8, i)) + iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) + } + goto _3 + _3: + ; + i++ + } + } + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35493, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 38705 + zCols = __ccgo_ts + 39279 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 38737 + zCols = __ccgo_ts + 39311 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35835, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36188, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37756, __ccgo_ts+38785, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38282, __ccgo_ts+39359, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36007, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36370, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -215726,10 +219570,10 @@ func _sqlite3Fts5StorageClose(tls *libc.TLS, p uintptr) (r int32) { /* Finalize all SQL statements */ i = 0 for { - if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(88)/libc.Uint64FromInt64(8))) { + if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(96)/libc.Uint64FromInt64(8))) { break } - Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(i)*8))) + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(p + 48 + uintptr(i)*8))) goto _1 _1: ; @@ -215780,29 +219624,75 @@ func _fts5StorageInsertCallback(tls *libc.TLS, pContext uintptr, tflags int32, p // C documentation // // /* +// ** This function is used as part of an UPDATE statement that modifies the +// ** rowid of a row. In that case, this function is called first to set +// ** Fts5Storage.pSavedRow to point to a statement that may be used to +// ** access the original values of the row being deleted - iDel. +// ** +// ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. +// ** It is not considered an error if row iDel does not exist. In this case +// ** pSavedRow is not set and SQLITE_OK returned. +// */ +func _sqlite3Fts5StorageFindDeleteRow(tls *libc.TLS, p uintptr, iDel Ti64) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var rc int32 + var _ /* pSeek at bp+0 */ uintptr + _ = rc + rc = SQLITE_OK + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + rc = _fts5StorageGetStmt(tls, p, libc.Int32FromInt32(FTS5_STMT_LOOKUP)+libc.Int32FromInt32(1), bp, uintptr(0)) + if rc == SQLITE_OK { + Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), iDel) + if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) != int32(SQLITE_ROW) { + rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) + } else { + (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow = *(*uintptr)(unsafe.Pointer(bp)) + } + } + return rc +} + +// C documentation +// +// /* // ** 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. +// ** +// ** If parameter bSaveRow is true, then Fts5Storage.pSavedRow is left +// ** pointing to a statement (FTS5_STMT_LOOKUP2) that may be used to access +// ** the original values of the row being deleted. This is used by UPDATE +// ** statements. // */ -func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uintptr) (r int32) { - bp := tls.Alloc(32) - defer tls.Free(32) - var iCol, nText, rc, rc2 int32 - var pConfig, zText uintptr +func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uintptr, bSaveRow int32) (r int32) { + bp := tls.Alloc(64) + defer tls.Free(64) + var iCol, rc, rc2 int32 + var pConfig, pVal uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx + var _ /* nLoc at bp+48 */ int32 + var _ /* nText at bp+32 */ int32 + var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr - _, _, _, _, _, _ = iCol, nText, pConfig, rc, rc2, zText + var _ /* pText at bp+24 */ uintptr + _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK if apVal == uintptr(0) { - rc = _fts5StorageGetStmt(tls, p, int32(FTS5_STMT_LOOKUP), bp, uintptr(0)) - if rc != SQLITE_OK { - return rc - } - Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), iDel) - if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) != int32(SQLITE_ROW) { - return Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) + if (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow != 0 && bSaveRow != 0 { + *(*uintptr)(unsafe.Pointer(bp)) = (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow + (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow = uintptr(0) + } else { + rc = _fts5StorageGetStmt(tls, p, int32(FTS5_STMT_LOOKUP)+bSaveRow, bp, uintptr(0)) + if rc != SQLITE_OK { + return rc + } + Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), iDel) + if Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) != int32(SQLITE_ROW) { + return Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) + } } } (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FpStorage = p @@ -215813,22 +219703,35 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { + pVal = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 32)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 48)) = 0 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - zText = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) - nText = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) + pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) } else { - if apVal != 0 { - zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol-int32(1))*8))) - nText = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol-int32(1))*8))) - } else { - goto _1 + pVal = *(*uintptr)(unsafe.Pointer(apVal + uintptr(iCol-int32(1))*8)) + } + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { + rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) + } else { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) } } - (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FszCol = 0 - rc = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_DOCUMENT), zText, nText, bp+8, __ccgo_fp(_fts5StorageInsertCallback)) - *(*Ti64)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol-int32(1))*8)) -= int64((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FszCol) - if *(*Ti64)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol-int32(1))*8)) < 0 { - rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) + if rc == SQLITE_OK { + _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 40)), *(*int32)(unsafe.Pointer(bp + 48))) + (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FszCol = 0 + rc = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_DOCUMENT), *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32)), bp+8, __ccgo_fp(_fts5StorageInsertCallback)) + *(*Ti64)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol-int32(1))*8)) -= int64((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FszCol) + if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr(iCol-int32(1))*8)) < 0 { + rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) + } + _sqlite3Fts5ClearLocale(tls, pConfig) } } goto _1 @@ -215841,9 +219744,13 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } else { (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow-- } - rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) - if rc == SQLITE_OK { - rc = rc2 + if rc == SQLITE_OK && bSaveRow != 0 { + (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow = *(*uintptr)(unsafe.Pointer(bp)) + } else { + rc2 = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) + if rc == SQLITE_OK { + rc = rc2 + } } return rc } @@ -215851,6 +219758,18 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint // C documentation // // /* +// ** Reset any saved statement pSavedRow. Zero pSavedRow as well. This +// ** should be called by the xUpdate() method of the fts5 table before +// ** returning from any operation that may have set Fts5Storage.pSavedRow. +// */ +func _sqlite3Fts5StorageReleaseDeleteRow(tls *libc.TLS, pStorage uintptr) { + Xsqlite3_reset(tls, (*TFts5Storage)(unsafe.Pointer(pStorage)).FpSavedRow) + (*TFts5Storage)(unsafe.Pointer(pStorage)).FpSavedRow = uintptr(0) +} + +// C documentation +// +// /* // ** This function is called to process a DELETE on a contentless_delete=1 // ** table. It adds the tombstone required to delete the entry with rowid // ** iDel. If successful, SQLITE_OK is returned. Or, if an error occurs, @@ -215910,12 +219829,12 @@ func _fts5StorageInsertDocsize(tls *libc.TLS, p uintptr, iRowid Ti64, pBuf uintp rc = _sqlite3Fts5IndexGetOrigin(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex, bp+8) Xsqlite3_bind_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3), *(*Ti64)(unsafe.Pointer(bp + 8))) } - if rc == SQLITE_OK { - Xsqlite3_bind_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(2), (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn, libc.UintptrFromInt32(0)) - Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) - rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) - Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(2)) - } + } + if rc == SQLITE_OK { + Xsqlite3_bind_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(2), (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fp, (*TFts5Buffer)(unsafe.Pointer(pBuf)).Fn, libc.UintptrFromInt32(0)) + Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) + rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) + Xsqlite3_bind_null(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(2)) } } return rc @@ -215987,7 +219906,7 @@ func _fts5StorageSaveTotals(tls *libc.TLS, p uintptr) (r int32) { // /* // ** Remove a row from the FTS table. // */ -func _sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel Ti64, apVal uintptr) (r int32) { +func _sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel Ti64, apVal uintptr, bSaveRow int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var pConfig uintptr @@ -216004,8 +219923,11 @@ func _sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel Ti64, apVal uintpt if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { rc = _fts5StorageContentlessDelete(tls, p, iDel) + if rc == SQLITE_OK && bSaveRow != 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FpConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { + rc = _sqlite3Fts5StorageFindDeleteRow(tls, p, iDel) + } } else { - rc = _fts5StorageDeleteFromIndex(tls, p, iDel, apVal) + rc = _fts5StorageDeleteFromIndex(tls, p, iDel, apVal, bSaveRow) } } /* Delete the %_docsize record */ @@ -216018,7 +219940,7 @@ func _sqlite3Fts5StorageDelete(tls *libc.TLS, p uintptr, iDel Ti64, apVal uintpt } } /* Delete the %_content record */ - if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { if rc == SQLITE_OK { rc = _fts5StorageGetStmt(tls, p, int32(FTS5_STMT_DELETE_CONTENT), bp, uintptr(0)) } @@ -216045,9 +219967,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38802, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39376, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38852, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39426, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + } + if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39455, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -216055,22 +219980,26 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36007, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36370, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } func _sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) + var iCol, rc2 int32 var iRowid Ti64 - var nText, rc2 int32 - var pConfig, zText uintptr + var pConfig, pVal uintptr var _ /* buf at bp+0 */ TFts5Buffer var _ /* ctx at bp+24 */ TFts5InsertCtx + var _ /* nLoc at bp+56 */ int32 + var _ /* nText at bp+44 */ int32 + var _ /* pLoc at bp+64 */ uintptr var _ /* pScan at bp+16 */ uintptr + var _ /* pText at bp+48 */ uintptr var _ /* rc at bp+40 */ int32 - _, _, _, _, _ = iRowid, nText, pConfig, rc2, zText + _, _, _, _, _ = iCol, iRowid, pConfig, pVal, rc2 *(*TFts5Buffer)(unsafe.Pointer(bp)) = TFts5Buffer{} pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) @@ -216094,9 +220023,27 @@ func _sqlite3Fts5StorageRebuild(tls *libc.TLS, p uintptr) (r int32) { } (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 24))).FszCol = 0 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 24))).FiCol)))) == 0 { - zText = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 24))).FiCol+int32(1)) - nText = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 24))).FiCol+int32(1)) - *(*int32)(unsafe.Pointer(bp + 40)) = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_DOCUMENT), zText, nText, bp+24, __ccgo_fp(_fts5StorageInsertCallback)) + *(*int32)(unsafe.Pointer(bp + 44)) = 0 /* Size of pText in bytes */ + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) /* Pointer to buffer containing text value */ + *(*int32)(unsafe.Pointer(bp + 56)) = 0 /* Size of pLoc in bytes */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Pointer to buffer containing text value */ + pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 24))).FiCol+int32(1)) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_EXTERNAL) && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { + *(*int32)(unsafe.Pointer(bp + 40)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+48, bp+44, bp+64, bp+56) + } else { + *(*uintptr)(unsafe.Pointer(bp + 48)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 44)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 { + iCol = (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 24))).FiCol + int32(1) + (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol + *(*uintptr)(unsafe.Pointer(bp + 64)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), iCol) + *(*int32)(unsafe.Pointer(bp + 56)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), iCol) + } + } + if *(*int32)(unsafe.Pointer(bp + 40)) == SQLITE_OK { + _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 64)), *(*int32)(unsafe.Pointer(bp + 56))) + *(*int32)(unsafe.Pointer(bp + 40)) = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_DOCUMENT), *(*uintptr)(unsafe.Pointer(bp + 48)), *(*int32)(unsafe.Pointer(bp + 44)), bp+24, __ccgo_fp(_fts5StorageInsertCallback)) + _sqlite3Fts5ClearLocale(tls, pConfig) + } } _sqlite3Fts5BufferAppendVarint(tls, bp+40, bp, int64((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 24))).FszCol)) *(*Ti64)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 24))).FiCol)*8)) += int64((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 24))).FszCol) @@ -216173,17 +220120,21 @@ func _fts5StorageNewRowid(tls *libc.TLS, p uintptr, piRowid uintptr) (r int32) { // /* // ** Insert a new row into the FTS content table. // */ -func _sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, piRowid uintptr) (r int32) { - bp := tls.Alloc(16) - defer tls.Free(16) - var i, rc int32 - var pConfig uintptr +func _sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, bReplace int32, apVal uintptr, piRowid uintptr) (r int32) { + bp := tls.Alloc(32) + defer tls.Free(32) + var bUnindexed, i, iLoc, rc int32 + var pConfig, pVal uintptr + var _ /* nLoc at bp+28 */ int32 + var _ /* nText at bp+24 */ int32 var _ /* pInsert at bp+0 */ uintptr - _, _, _ = i, pConfig, rc + var _ /* pLoc at bp+16 */ uintptr + var _ /* pText at bp+8 */ uintptr + _, _, _, _, _, _ = bUnindexed, i, iLoc, pConfig, pVal, rc pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig rc = SQLITE_OK /* Insert the new row into the %_content table. */ - if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != int32(FTS5_CONTENT_UNINDEXED) { if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) == int32(SQLITE_INTEGER) { *(*Ti64)(unsafe.Pointer(piRowid)) = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apVal + 1*8))) } else { @@ -216191,13 +220142,48 @@ func _sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, p } } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Counter variable */ - rc = _fts5StorageGetStmt(tls, p, int32(FTS5_STMT_INSERT_CONTENT), bp, uintptr(0)) - i = int32(1) + rc = _fts5StorageGetStmt(tls, p, int32(FTS5_STMT_INSERT_CONTENT)+bReplace, bp, uintptr(0)) + if *(*uintptr)(unsafe.Pointer(bp)) != 0 { + Xsqlite3_clear_bindings(tls, *(*uintptr)(unsafe.Pointer(bp))) + } + /* Bind the rowid value */ + Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), *(*uintptr)(unsafe.Pointer(apVal + 1*8))) + /* Loop through values for user-defined columns. i=2 is the leftmost + ** user-defined column. As is column 1 of pSavedRow. */ + i = int32(2) for { if !(rc == SQLITE_OK && i <= (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol+int32(1)) { break } - rc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp)), i, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) + bUnindexed = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i-int32(2))))) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || bUnindexed != 0 { + pVal = *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8)) + if Xsqlite3_value_nochange(tls, pVal) != 0 && (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow != 0 { + /* This is an UPDATE statement, and user-defined column (i-2) was not + ** modified. Retrieve the value from Fts5Storage.pSavedRow. */ + pVal = Xsqlite3_column_value(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow, i-int32(1)) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && bUnindexed == 0 { + Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp)), (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol+i, Xsqlite3_column_value(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow, (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol+i-int32(1))) + } + } else { + if _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 24)) = 0 + *(*int32)(unsafe.Pointer(bp + 28)) = 0 + rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+24, bp+16, bp+28) + if rc == SQLITE_OK { + Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), i, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 24)), uintptr(-libc.Int32FromInt32(1))) + if bUnindexed == 0 { + iLoc = (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol + i + Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iLoc, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*int32)(unsafe.Pointer(bp + 28)), uintptr(-libc.Int32FromInt32(1))) + } + } + goto _1 + } + } + rc = Xsqlite3_bind_value(tls, *(*uintptr)(unsafe.Pointer(bp)), i, pVal) + } goto _1 _1: ; @@ -216218,14 +220204,18 @@ func _sqlite3Fts5StorageContentInsert(tls *libc.TLS, p uintptr, apVal uintptr, p // ** Insert new entries into the FTS index and %_docsize table. // */ func _sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRowid Ti64) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) - var nText int32 - var pConfig, zText uintptr + bp := tls.Alloc(80) + defer tls.Free(80) + var iCol int32 + var pConfig, pVal uintptr var _ /* buf at bp+24 */ TFts5Buffer var _ /* ctx at bp+8 */ TFts5InsertCtx + var _ /* nLoc at bp+56 */ int32 + var _ /* nText at bp+40 */ int32 + var _ /* pLoc at bp+64 */ uintptr + var _ /* pText at bp+48 */ uintptr var _ /* rc at bp+0 */ int32 - _, _, _ = nText, pConfig, zText + _, _, _ = iCol, pConfig, pVal pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK /* Buffer used to build up %_docsize blob */ libc.Xmemset(tls, bp+24, 0, uint64(16)) @@ -216241,9 +220231,32 @@ func _sqlite3Fts5StorageIndexInsert(tls *libc.TLS, p uintptr, apVal uintptr, iRo } (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FszCol = 0 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FiCol)))) == 0 { - zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FiCol+int32(2))*8))) - nText = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FiCol+int32(2))*8))) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_DOCUMENT), zText, nText, bp+8, __ccgo_fp(_fts5StorageInsertCallback)) + *(*int32)(unsafe.Pointer(bp + 40)) = 0 /* Size of pText in bytes */ + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) /* Pointer to buffer containing text value */ + *(*int32)(unsafe.Pointer(bp + 56)) = 0 /* Size of pText in bytes */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Pointer to buffer containing text value */ + pVal = *(*uintptr)(unsafe.Pointer(apVal + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FiCol+int32(2))*8)) + if (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow != 0 && Xsqlite3_value_nochange(tls, pVal) != 0 { + pVal = Xsqlite3_column_value(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow, (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FiCol+int32(1)) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL && (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 { + iCol = (*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FiCol + int32(1) + (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol + *(*uintptr)(unsafe.Pointer(bp + 64)) = Xsqlite3_column_text(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow, iCol) + *(*int32)(unsafe.Pointer(bp + 56)) = Xsqlite3_column_bytes(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpSavedRow, iCol) + } + } else { + pVal = *(*uintptr)(unsafe.Pointer(apVal + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FiCol+int32(2))*8)) + } + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+48, bp+40, bp+64, bp+56) + } else { + *(*uintptr)(unsafe.Pointer(bp + 48)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 40)) = Xsqlite3_value_bytes(tls, pVal) + } + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { + _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 64)), *(*int32)(unsafe.Pointer(bp + 56))) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_DOCUMENT), *(*uintptr)(unsafe.Pointer(bp + 48)), *(*int32)(unsafe.Pointer(bp + 40)), bp+8, __ccgo_fp(_fts5StorageInsertCallback)) + _sqlite3Fts5ClearLocale(tls, pConfig) + } } _sqlite3Fts5BufferAppendVarint(tls, bp, bp+24, int64((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FszCol)) *(*Ti64)(unsafe.Pointer((*TFts5Storage)(unsafe.Pointer(p)).FaTotalSize + uintptr((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FiCol)*8)) += int64((*(*TFts5InsertCtx)(unsafe.Pointer(bp + 8))).FszCol) @@ -216269,7 +220282,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+38881, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39484, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -216382,15 +220395,19 @@ func _fts5StorageIntegrityCallback(tls *libc.TLS, pContext uintptr, tflags int32 // ** determine this. // */ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) - var aColSize, aTotalSize, pConfig, zText uintptr - var bUseCksum, i, i1, nText, rc, rc2 int32 + bp := tls.Alloc(96) + defer tls.Free(96) + var aColSize, aTotalSize, pConfig, pVal uintptr + var bUseCksum, i, i1, iCol, rc, rc2 int32 var _ /* ctx at bp+0 */ TFts5IntegrityCtx - var _ /* nRow at bp+48 */ Ti64 - var _ /* nRow at bp+56 */ Ti64 + var _ /* nLoc at bp+72 */ int32 + var _ /* nRow at bp+80 */ Ti64 + var _ /* nRow at bp+88 */ Ti64 + var _ /* nText at bp+56 */ int32 + var _ /* pLoc at bp+64 */ uintptr var _ /* pScan at bp+40 */ uintptr - _, _, _, _, _, _, _, _, _, _ = aColSize, aTotalSize, bUseCksum, i, i1, nText, pConfig, rc, rc2, zText + var _ /* pText at bp+48 */ uintptr + _, _, _, _, _, _, _, _, _, _ = aColSize, aTotalSize, bUseCksum, i, i1, iCol, pConfig, pVal, rc, rc2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint64(40)) @@ -216421,26 +220438,44 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 if !(rc == SQLITE_OK && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } - if *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - goto _1 - } - (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FiCol = i - (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FszCol = 0 - if (*TFts5Config)(unsafe.Pointer(pConfig)).FeDetail == int32(FTS5_DETAIL_COLUMNS) { - rc = _sqlite3Fts5TermsetNew(tls, bp+24) - } - if rc == SQLITE_OK { - zText = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), i+int32(1)) - nText = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), i+int32(1)) - rc = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_DOCUMENT), zText, nText, bp, __ccgo_fp(_fts5StorageIntegrityCallback)) - } - if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 && (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FszCol != *(*int32)(unsafe.Pointer(aColSize + uintptr(i)*4)) { - rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) - } - *(*Ti64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) += int64((*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FszCol) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FeDetail == int32(FTS5_DETAIL_COLUMNS) { - _sqlite3Fts5TermsetFree(tls, (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpTermset) - (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpTermset = uintptr(0) + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 56)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) + *(*int32)(unsafe.Pointer(bp + 72)) = 0 + pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), i+int32(1)) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_EXTERNAL) && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { + rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+48, bp+56, bp+64, bp+72) + } else { + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL && (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 { + iCol = i + int32(1) + (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol + *(*uintptr)(unsafe.Pointer(bp + 64)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), iCol) + *(*int32)(unsafe.Pointer(bp + 72)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp + 40)), iCol) + } + *(*uintptr)(unsafe.Pointer(bp + 48)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 56)) = Xsqlite3_value_bytes(tls, pVal) + } + (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FiCol = i + (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FszCol = 0 + if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeDetail == int32(FTS5_DETAIL_COLUMNS) { + rc = _sqlite3Fts5TermsetNew(tls, bp+24) + } + if rc == SQLITE_OK { + _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 64)), *(*int32)(unsafe.Pointer(bp + 72))) + rc = _sqlite3Fts5Tokenize(tls, pConfig, int32(FTS5_TOKENIZE_DOCUMENT), *(*uintptr)(unsafe.Pointer(bp + 48)), *(*int32)(unsafe.Pointer(bp + 56)), bp, __ccgo_fp(_fts5StorageIntegrityCallback)) + _sqlite3Fts5ClearLocale(tls, pConfig) + } + /* If this is not a columnsize=0 database, check that the number + ** of tokens in the value matches the aColSize[] value read from + ** the %_docsize table. */ + if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 && (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FszCol != *(*int32)(unsafe.Pointer(aColSize + uintptr(i)*4)) { + rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) + } + *(*Ti64)(unsafe.Pointer(aTotalSize + uintptr(i)*8)) += int64((*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FszCol) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FeDetail == int32(FTS5_DETAIL_COLUMNS) { + _sqlite3Fts5TermsetFree(tls, (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpTermset) + (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpTermset = uintptr(0) + } } goto _1 _1: @@ -216478,16 +220513,16 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 /* Check that the %_docsize and %_content tables contain the expected ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - *(*Ti64)(unsafe.Pointer(bp + 48)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35268, bp+48) - if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 48)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { + *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 + rc = _fts5StorageCount(tls, p, __ccgo_ts+35493, bp+80) + if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - *(*Ti64)(unsafe.Pointer(bp + 56)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35835, bp+56) - if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 56)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { + *(*Ti64)(unsafe.Pointer(bp + 88)) = 0 + rc = _fts5StorageCount(tls, p, __ccgo_ts+36188, bp+88) + if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 88)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) } } @@ -216513,7 +220548,7 @@ func _sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, _ = rc rc = _fts5StorageGetStmt(tls, p, eStmt, pp, pzErrMsg) if rc == SQLITE_OK { - *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(eStmt)*8)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(p + 48 + uintptr(eStmt)*8)) = uintptr(0) } return rc } @@ -216526,9 +220561,9 @@ func _sqlite3Fts5StorageStmt(tls *libc.TLS, p uintptr, eStmt int32, pp uintptr, // ** must match that passed to the sqlite3Fts5StorageStmt() call. // */ func _sqlite3Fts5StorageStmtRelease(tls *libc.TLS, p uintptr, eStmt int32, pStmt uintptr) { - if *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(eStmt)*8)) == uintptr(0) { + if *(*uintptr)(unsafe.Pointer(p + 48 + uintptr(eStmt)*8)) == uintptr(0) { Xsqlite3_reset(tls, pStmt) - *(*uintptr)(unsafe.Pointer(p + 40 + uintptr(eStmt)*8)) = pStmt + *(*uintptr)(unsafe.Pointer(p + 48 + uintptr(eStmt)*8)) = pStmt } else { Xsqlite3_finalize(tls, pStmt) } @@ -216851,14 +220886,14 @@ func _fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, libc.Xmemcpy(tls, p, uintptr(unsafe.Pointer(&_aAsciiTokenChar)), uint64(128)) i = 0 for { - if !(rc == SQLITE_OK && i < nArg-int32(1)) { + if !(rc == SQLITE_OK && i < nArg) { break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+38913) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39516) { _fts5AsciiAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+38924) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39527) { _fts5AsciiAddExceptions(tls, p, zArg, 0) } else { rc = int32(SQLITE_ERROR) @@ -216869,9 +220904,6 @@ func _fts5AsciiCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, ; i += int32(2) } - if rc == SQLITE_OK && i < nArg { - rc = int32(SQLITE_ERROR) - } if rc != SQLITE_OK { _fts5AsciiDelete(tls, p) p = uintptr(0) @@ -217017,7 +221049,7 @@ func _fts5UnicodeAddExceptions(tls *libc.TLS, p uintptr, z uintptr, bTokenChars iCode = uint32(*(*uint8)(unsafe.Pointer(v1))) if iCode >= uint32(0xc0) { iCode = uint32(_sqlite3Utf8Trans1[iCode-uint32(0xc0)]) - for zCsr != zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { + for zCsr < zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { v2 = zCsr zCsr++ iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v2)))) @@ -217141,7 +221173,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 38935 + zCat = __ccgo_ts + 39538 libc.Xmemset(tls, p, 0, uint64(192)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) @@ -217152,10 +221184,10 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 /* Search for a "categories" argument */ i = 0 for { - if !(rc == SQLITE_OK && i < nArg-int32(1)) { + if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+38944) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39547) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -217168,24 +221200,24 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } i = 0 for { - if !(rc == SQLITE_OK && i < nArg-int32(1)) { + if !(rc == SQLITE_OK && i < nArg) { break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+38955) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39558) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+38913) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39516) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+38924) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39527) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+38944) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39547) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -217198,9 +221230,6 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 ; i += int32(2) } - if i < nArg && rc == SQLITE_OK { - rc = int32(SQLITE_ERROR) - } } else { rc = int32(SQLITE_NOMEM) } @@ -217261,7 +221290,7 @@ _2: iCode = uint32(*(*uint8)(unsafe.Pointer(v3))) if iCode >= uint32(0xc0) { iCode = uint32(_sqlite3Utf8Trans1[iCode-uint32(0xc0)]) - for zCsr != zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { + for zCsr < zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { v4 = zCsr zCsr++ iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4)))) @@ -217315,7 +221344,7 @@ _6: iCode = uint32(*(*uint8)(unsafe.Pointer(v10))) if iCode >= uint32(0xc0) { iCode = uint32(_sqlite3Utf8Trans1[iCode-uint32(0xc0)]) - for zCsr != zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { + for zCsr < zTerm && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zCsr)))&int32(0xc0) == int32(0x80) { v11 = zCsr zCsr++ iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v11)))) @@ -217432,17 +221461,17 @@ tokenize_done: ** stemming. */ type TPorterTokenizer = struct { - Ftokenizer Tfts5_tokenizer - FpTokenizer uintptr - FaBuf [128]uint8 + Ftokenizer_v2 Tfts5_tokenizer_v2 + FpTokenizer uintptr + FaBuf [128]uint8 } type PorterTokenizer = TPorterTokenizer type TPorterTokenizer1 = struct { - Ftokenizer Tfts5_tokenizer - FpTokenizer uintptr - FaBuf [128]uint8 + Ftokenizer_v2 Tfts5_tokenizer_v2 + FpTokenizer uintptr + FaBuf [128]uint8 } type PorterTokenizer1 = TPorterTokenizer1 @@ -217458,7 +221487,7 @@ func _fts5PorterDelete(tls *libc.TLS, pTok uintptr) { if pTok != 0 { p = pTok if (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer.FxDelete})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxDelete})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer) } Xsqlite3_free(tls, p) } @@ -217472,21 +221501,23 @@ func _fts5PorterDelete(tls *libc.TLS, pTok uintptr) { func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var azArg2, pApi, pRet, zBase, v2 uintptr + var az2, pApi, pRet, zBase, v2 uintptr var nArg2, rc, v1 int32 var _ /* pUserdata at bp+0 */ uintptr - _, _, _, _, _, _, _, _ = azArg2, nArg2, pApi, pRet, rc, zBase, v1, v2 + var _ /* pV2 at bp+8 */ uintptr + _, _, _, _, _, _, _, _ = az2, nArg2, pApi, pRet, rc, zBase, v1, v2 pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 38973 + zBase = __ccgo_ts + 39576 + *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) } - pRet = Xsqlite3_malloc(tls, int32(160)) + pRet = Xsqlite3_malloc(tls, int32(168)) if pRet != 0 { - libc.Xmemset(tls, pRet, 0, uint64(160)) - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxFindTokenizer})))(tls, pApi, zBase, bp, pRet) + libc.Xmemset(tls, pRet, 0, uint64(168)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxFindTokenizer_v2})))(tls, pApi, zBase, bp, bp+8) } else { rc = int32(SQLITE_NOMEM) } @@ -217502,8 +221533,9 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p } else { v2 = uintptr(0) } - azArg2 = v2 - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(pRet)).Ftokenizer.FxCreate})))(tls, *(*uintptr)(unsafe.Pointer(bp)), azArg2, nArg2, pRet+24) + az2 = v2 + libc.Xmemcpy(tls, pRet, *(*uintptr)(unsafe.Pointer(bp + 8)), uint64(32)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(pRet)).Ftokenizer_v2.FxCreate})))(tls, *(*uintptr)(unsafe.Pointer(bp)), az2, nArg2, pRet+32) } if rc != SQLITE_OK { _fts5PorterDelete(tls, pRet) @@ -217694,64 +221726,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38983, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39586, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38986, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39589, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38991, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39594, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38996, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39599, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+38999, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39602, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39002, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39605, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39007, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39610, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39012, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39615, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39016, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39619, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39022, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39625, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39027, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39630, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -217760,49 +221792,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39031, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39634, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39035, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39638, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39038, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39641, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39042, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39645, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39046, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39649, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39050, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39653, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39054, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39657, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39058, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39661, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -217819,20 +221851,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39062, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39042, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39665, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39645, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39065, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39068, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39668, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39671, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39072, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39058, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39675, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39661, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -217848,75 +221880,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39075, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39678, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39042, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39645, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39083, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39686, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39090, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39693, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39095, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39698, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38991, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39594, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39100, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39703, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38986, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39589, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39105, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39708, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39058, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39661, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39110, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39713, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+15986, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16048, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39115, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39718, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39068, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39671, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39119, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39722, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38983, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39586, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39124, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39727, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39027, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39630, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39130, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39733, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39134, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39737, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39136, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39050, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39653, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -217925,48 +221957,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39142, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39058, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39661, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39150, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39753, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39042, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39645, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39156, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39042, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39645, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39161, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39764, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38983, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39167, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39054, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39657, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39175, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39183, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39786, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39187, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39790, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39050, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39653, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -217974,21 +222006,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39195, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39798, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38983, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39201, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39804, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39054, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39657, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39207, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39810, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39068, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39671, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -218006,48 +222038,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39214, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39817, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+38999, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39602, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39219, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39822, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39224, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39827, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38999, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39602, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39230, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39833, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38999, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39602, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39183, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39786, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39236, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39839, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39242, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39845, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+38983, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -218063,13 +222095,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39248, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39851, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39252, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39855, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39255, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -218077,7 +222109,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39258, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39861, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -218174,7 +222206,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) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr @@ -218183,8 +222215,8 @@ func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags p = pTokenizer (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx - (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 32 - return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, __ccgo_fp(_fts5PorterCb)) + (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 + return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) } // C documentation @@ -218225,55 +222257,57 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p var pNew, zArg uintptr _, _, _, _, _ = i, pNew, rc, zArg, v2 rc = SQLITE_OK - pNew = Xsqlite3_malloc(tls, int32(8)) + pNew = uintptr(0) _ = pUnused - if pNew == uintptr(0) { - rc = int32(SQLITE_NOMEM) + if nArg%int32(2) != 0 { + rc = int32(SQLITE_ERROR) } else { - (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = int32(1) - (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FiFoldParam = 0 - i = 0 - for { - if !(rc == SQLITE_OK && i < nArg-int32(1)) { - break - } - zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39262) { - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { - rc = int32(SQLITE_ERROR) - } else { - (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('0')) + pNew = Xsqlite3_malloc(tls, int32(8)) + if pNew == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } else { + (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = int32(1) + (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FiFoldParam = 0 + i = 0 + for { + if !(rc == SQLITE_OK && i < nArg) { + break } - } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+38955) { - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { + zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39865) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') { - v2 = int32(2) + (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('0')) + } + } else { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39558) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { + rc = int32(SQLITE_ERROR) } else { - v2 = 0 + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') { + v2 = int32(2) + } else { + v2 = 0 + } + (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FiFoldParam = v2 } - (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FiFoldParam = v2 + } else { + rc = int32(SQLITE_ERROR) } - } else { - rc = int32(SQLITE_ERROR) } + goto _1 + _1: + ; + i += int32(2) + } + if (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FiFoldParam != 0 && (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold == 0 { + rc = int32(SQLITE_ERROR) + } + if rc != SQLITE_OK { + _fts5TriDelete(tls, pNew) + pNew = uintptr(0) } - goto _1 - _1: - ; - i += int32(2) - } - if i < nArg && rc == SQLITE_OK { - rc = int32(SQLITE_ERROR) - } - if (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FiFoldParam != 0 && (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold == 0 { - rc = int32(SQLITE_ERROR) - } - if rc != SQLITE_OK { - _fts5TriDelete(tls, pNew) - pNew = uintptr(0) } } *(*uintptr)(unsafe.Pointer(ppOut)) = pNew @@ -218291,14 +222325,20 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int var aStart [3]int32 var iCode Tu32 var iNext, ii, rc int32 - var p, z1, zEof, zIn, zOut, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v3, v4, v5, v6, v7, v8, v9 uintptr + var p, z1, zEof, zIn, zOut, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v3, v4, v5, v6, v7, v8, v9 uintptr var _ /* aBuf at bp+0 */ [32]uint8 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aStart, iCode, iNext, ii, p, rc, z1, zEof, zIn, zOut, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v3, v4, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aStart, iCode, iNext, ii, p, rc, z1, zEof, zIn, zOut, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v3, v4, v5, v6, v7, v8, v9 p = pTok rc = SQLITE_OK zOut = bp zIn = pText - zEof = zIn + uintptr(nText) /* Input offset of each character in aBuf[] */ + if zIn != 0 { + v1 = zIn + uintptr(nText) + } else { + v1 = uintptr(0) + } + zEof = v1 + iCode = uint32(0) /* Input offset of each character in aBuf[] */ _ = unusedFlags /* Populate aBuf[] with the characters for the first trigram. */ ii = 0 @@ -218308,68 +222348,68 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } for cond := true; cond; cond = iCode == uint32(0) { aStart[ii] = int32(int64(zIn) - int64(pText)) - v2 = zIn + if zIn >= zEof { + return SQLITE_OK + } + v3 = zIn zIn++ - iCode = uint32(*(*uint8)(unsafe.Pointer(v2))) + iCode = uint32(*(*uint8)(unsafe.Pointer(v3))) if iCode >= uint32(0xc0) { iCode = uint32(_sqlite3Utf8Trans1[iCode-uint32(0xc0)]) - for zIn != zEof && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { - v3 = zIn + for zIn < zEof && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { + v4 = zIn zIn++ - iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v3)))) + iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4)))) } if iCode < uint32(0x80) || iCode&uint32(0xFFFFF800) == uint32(0xD800) || iCode&uint32(0xFFFFFFFE) == uint32(0xFFFE) { iCode = uint32(0xFFFD) } } - if iCode == uint32(0) { - return SQLITE_OK - } if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { iCode = libc.Uint32FromInt32(_sqlite3Fts5UnicodeFold(tls, libc.Int32FromUint32(iCode), (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam)) } } if iCode < uint32(0x00080) { - v4 = zOut + v5 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v4)) = uint8(iCode & libc.Uint32FromInt32(0xFF)) + *(*uint8)(unsafe.Pointer(v5)) = uint8(iCode & libc.Uint32FromInt32(0xFF)) } else { if iCode < uint32(0x00800) { - v5 = zOut - zOut++ - *(*uint8)(unsafe.Pointer(v5)) = libc.Uint8FromInt32(int32(0xC0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) v6 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v6)) = libc.Uint8FromInt32(int32(0xC0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) + v7 = zOut + zOut++ + *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } else { if iCode < uint32(0x10000) { - v7 = zOut - zOut++ - *(*uint8)(unsafe.Pointer(v7)) = libc.Uint8FromInt32(int32(0xE0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) v8 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v8)) = libc.Uint8FromInt32(int32(0xE0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) v9 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) - } else { + *(*uint8)(unsafe.Pointer(v9)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v10 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v10)) = libc.Uint8FromInt32(int32(0xF0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(v10)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + } else { v11 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v11)) = libc.Uint8FromInt32(int32(0xF0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) v12 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v12)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) v13 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v13)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + v14 = zOut + zOut++ + *(*uint8)(unsafe.Pointer(v14)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } } } - goto _1 - _1: + goto _2 + _2: ; ii++ } @@ -218384,23 +222424,24 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int /* Read characters from the input up until the first non-diacritic */ for cond := true; cond; cond = iCode == uint32(0) { iNext = int32(int64(zIn) - int64(pText)) - v14 = zIn + if zIn >= zEof { + iCode = uint32(0) + break + } + v15 = zIn zIn++ - iCode = uint32(*(*uint8)(unsafe.Pointer(v14))) + iCode = uint32(*(*uint8)(unsafe.Pointer(v15))) if iCode >= uint32(0xc0) { iCode = uint32(_sqlite3Utf8Trans1[iCode-uint32(0xc0)]) - for zIn != zEof && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { - v15 = zIn + for zIn < zEof && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn)))&int32(0xc0) == int32(0x80) { + v16 = zIn zIn++ - iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v15)))) + iCode = iCode<<libc.Int32FromInt32(6) + libc.Uint32FromInt32(libc.Int32FromInt32(0x3f)&libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v16)))) } if iCode < uint32(0x80) || iCode&uint32(0xFFFFF800) == uint32(0xD800) || iCode&uint32(0xFFFFFFFE) == uint32(0xFFFE) { iCode = uint32(0xFFFD) } } - if iCode == uint32(0) { - break - } if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { iCode = libc.Uint32FromInt32(_sqlite3Fts5UnicodeFold(tls, libc.Int32FromUint32(iCode), (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam)) } @@ -218413,9 +222454,9 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int /* Remove the first character from buffer aBuf[]. Append the character ** with codepoint iCode. */ z1 = bp - v16 = z1 + v17 = z1 z1++ - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v16))) >= int32(0xc0) { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v17))) >= int32(0xc0) { for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z1)))&int32(0xc0) == int32(0x80) { z1++ } @@ -218423,41 +222464,41 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int libc.Xmemmove(tls, bp, z1, libc.Uint64FromInt64(int64(zOut)-int64(z1))) zOut -= uintptr(int64(z1) - t__predefined_ptrdiff_t(bp)) if iCode < uint32(0x00080) { - v17 = zOut + v18 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v17)) = uint8(iCode & libc.Uint32FromInt32(0xFF)) + *(*uint8)(unsafe.Pointer(v18)) = uint8(iCode & libc.Uint32FromInt32(0xFF)) } else { if iCode < uint32(0x00800) { - v18 = zOut - zOut++ - *(*uint8)(unsafe.Pointer(v18)) = libc.Uint8FromInt32(int32(0xC0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) v19 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v19)) = libc.Uint8FromInt32(int32(0xC0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1F)))) + v20 = zOut + zOut++ + *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } else { if iCode < uint32(0x10000) { - v20 = zOut - zOut++ - *(*uint8)(unsafe.Pointer(v20)) = libc.Uint8FromInt32(int32(0xE0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) v21 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v21)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v21)) = libc.Uint8FromInt32(int32(0xE0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0F)))) v22 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v22)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) - } else { + *(*uint8)(unsafe.Pointer(v22)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) v23 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(0xF0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(v23)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + } else { v24 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v24)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v24)) = libc.Uint8FromInt32(int32(0xF0) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) v25 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v25)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3F)))) v26 = zOut zOut++ - *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) + *(*uint8)(unsafe.Pointer(v26)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3F)))) + v27 = zOut + zOut++ + *(*uint8)(unsafe.Pointer(v27)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(iCode&libc.Uint32FromInt32(0x3F)))) } } } @@ -218503,26 +222544,38 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // C documentation // // /* +// ** Return true if the tokenizer described by p->azArg[] is the trigram +// ** tokenizer. This tokenizer needs to be loaded before xBestIndex is +// ** called for the first time in order to correctly handle LIKE/GLOB. +// */ +func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39880)) +} + +// C documentation +// +// /* // ** Register all built-in tokenizers with FTS5. // */ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { bp := tls.Alloc(128) defer tls.Free(128) var i, rc int32 - var _ /* aBuiltin at bp+0 */ [4]struct { + var _ /* aBuiltin at bp+0 */ [3]struct { FzName uintptr Fx Tfts5_tokenizer } + var _ /* sPorter at bp+96 */ Tfts5_tokenizer_v2 _, _ = i, rc - *(*[4]struct { + *(*[3]struct { FzName uintptr Fx Tfts5_tokenizer - })(unsafe.Pointer(bp)) = [4]struct { + })(unsafe.Pointer(bp)) = [3]struct { FzName uintptr Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 38973, + FzName: __ccgo_ts + 39576, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -218530,7 +222583,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39277, + FzName: __ccgo_ts + 39888, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -218538,15 +222591,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39283, - Fx: Tfts5_tokenizer{ - FxCreate: __ccgo_fp(_fts5PorterCreate), - FxDelete: __ccgo_fp(_fts5PorterDelete), - FxTokenize: __ccgo_fp(_fts5PorterTokenize), - }, - }, - 3: { - FzName: __ccgo_ts + 39290, + FzName: __ccgo_ts + 39880, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -218557,10 +222602,10 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { rc = SQLITE_OK /* To iterate through builtin functions */ i = 0 for { - if !(rc == SQLITE_OK && i < libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(32))) { + if !(rc == SQLITE_OK && i < libc.Int32FromUint64(libc.Uint64FromInt64(96)/libc.Uint64FromInt64(32))) { break } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer})))(tls, pApi, (*(*[4]struct { + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer})))(tls, pApi, (*(*[3]struct { FzName uintptr Fx Tfts5_tokenizer })(unsafe.Pointer(bp)))[i].FzName, pApi, bp+uintptr(i)*32+8, uintptr(0)) @@ -218569,6 +222614,15 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { ; i++ } + if rc == SQLITE_OK { + *(*Tfts5_tokenizer_v2)(unsafe.Pointer(bp + 96)) = Tfts5_tokenizer_v2{ + FiVersion: int32(2), + FxCreate: __ccgo_fp(_fts5PorterCreate), + FxDelete: __ccgo_fp(_fts5PorterDelete), + FxTokenize: __ccgo_fp(_fts5PorterTokenize), + } + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39894, pApi, bp+96, uintptr(0)) + } return rc } @@ -220004,7 +224058,8 @@ func _sqlite3Fts5UnicodeCatParse(tls *libc.TLS, zCat uintptr, aArray uintptr) (r default: return int32(1) } - break + default: + return int32(1) } return 0 } @@ -224015,6 +228070,7 @@ type TFts5VocabCursor = struct { FpStruct uintptr FnLeTerm int32 FzLeTerm uintptr + FcolUsed int32 FiCol int32 FaCnt uintptr FaDoc uintptr @@ -224047,6 +228103,7 @@ type TFts5VocabCursor1 = struct { FpStruct uintptr FnLeTerm int32 FzLeTerm uintptr + FcolUsed int32 FiCol int32 FaCnt uintptr FaDoc uintptr @@ -224080,16 +228137,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39298) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39901) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39302) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39905) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39306) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39909) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39315, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39918, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -224158,15 +228215,15 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39349, - 1: __ccgo_ts + 39389, - 2: __ccgo_ts + 39424, + 0: __ccgo_ts + 39952, + 1: __ccgo_ts + 39992, + 2: __ccgo_ts + 40027, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+23894, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+23975, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39467, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40070, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -224247,7 +228304,7 @@ func _fts5VocabBestIndexMethod(tls *libc.TLS, pUnused uintptr, pInfo uintptr) (r iTermEq = -int32(1) iTermGe = -int32(1) iTermLe = -int32(1) - idxNum = 0 + idxNum = libc.Int32FromUint64((*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FcolUsed) nArg = 0 _ = pUnused i = 0 @@ -224336,10 +228393,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39500, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40103, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39531, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40134, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -224358,7 +228415,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39582, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40185, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -224475,13 +228532,15 @@ func _fts5VocabInstanceNext(tls *libc.TLS, pCsr uintptr) (r int32) { func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - var bCmp, eDetail, iCol, ii, nCmp, nCol, nPos, v2 int32 + var bCmp, eDetail, iCol, ii1, nCmp, nCol, nPos, v2 int32 var pCsr, pPos, pTab, zTerm uintptr + var v3, v4 Ti64 var _ /* iOff at bp+16 */ int32 var _ /* iPos at bp+8 */ Ti64 + var _ /* ii at bp+20 */ Tu32 var _ /* nTerm at bp+4 */ int32 var _ /* rc at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _ = bCmp, eDetail, iCol, ii, nCmp, nCol, nPos, pCsr, pPos, pTab, zTerm, v2 + _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bCmp, eDetail, iCol, ii1, nCmp, nCol, nPos, pCsr, pPos, pTab, zTerm, v2, v3, v4 pCsr = pCursor pTab = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Table)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FpFts5)).FpConfig)).FnCol @@ -224538,9 +228597,30 @@ func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { nPos = (*TFts5IndexIter)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FpIter)).FnData switch (*TFts5VocabTable)(unsafe.Pointer(pTab)).FeType { case int32(FTS5_VOCAB_ROW): - if eDetail == FTS5_DETAIL_FULL { - for 0 == _sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+16, bp+8) { - *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt))++ + /* Do not bother counting the number of instances if the "cnt" + ** column is not being read (according to colUsed). */ + if eDetail == FTS5_DETAIL_FULL && (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FcolUsed&int32(0x04) != 0 { + for *(*Ti64)(unsafe.Pointer(bp + 8)) < int64(nPos) { + v3 = *(*Ti64)(unsafe.Pointer(bp + 8)) + *(*Ti64)(unsafe.Pointer(bp + 8))++ + *(*Tu32)(unsafe.Pointer(bp + 20)) = uint32(*(*Tu8)(unsafe.Pointer(pPos + uintptr(v3)))) + if *(*Tu32)(unsafe.Pointer(bp + 20))&uint32(0x80) != 0 { + *(*Ti64)(unsafe.Pointer(bp + 8))-- + *(*Ti64)(unsafe.Pointer(bp + 8)) += int64(_sqlite3Fts5GetVarint32(tls, pPos+uintptr(*(*Ti64)(unsafe.Pointer(bp + 8))), bp+20)) + } + if *(*Tu32)(unsafe.Pointer(bp + 20)) == uint32(1) { + /* New column in the position list */ + v4 = *(*Ti64)(unsafe.Pointer(bp + 8)) + *(*Ti64)(unsafe.Pointer(bp + 8))++ + *(*Tu32)(unsafe.Pointer(bp + 20)) = uint32(*(*Tu8)(unsafe.Pointer(pPos + uintptr(v4)))) + if *(*Tu32)(unsafe.Pointer(bp + 20))&uint32(0x80) != 0 { + *(*Ti64)(unsafe.Pointer(bp + 8))-- + *(*Ti64)(unsafe.Pointer(bp + 8)) += int64(_sqlite3Fts5GetVarint32(tls, pPos+uintptr(*(*Ti64)(unsafe.Pointer(bp + 8))), bp+20)) + } + } else { + /* An instance - increment pCsr->aCnt[] */ + *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt))++ + } } } *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc))++ @@ -224548,16 +228628,16 @@ func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { if eDetail == FTS5_DETAIL_FULL { iCol = -int32(1) for 0 == _sqlite3Fts5PoslistNext64(tls, pPos, nPos, bp+16, bp+8) { - ii = int32(*(*Ti64)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(32)) - if iCol != ii { - if ii >= nCol { + ii1 = int32(*(*Ti64)(unsafe.Pointer(bp + 8)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) + if iCol != ii1 { + if ii1 >= nCol { *(*int32)(unsafe.Pointer(bp)) = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)<<libc.Int32FromInt32(8) break } - *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(ii)*8))++ - iCol = ii + *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr(ii1)*8))++ + iCol = ii1 } - *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr(ii)*8))++ + *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaCnt + uintptr(ii1)*8))++ } } else { if eDetail == int32(FTS5_DETAIL_COLUMNS) { @@ -224598,8 +228678,8 @@ func _fts5VocabNextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { if !((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol < nCol && *(*Ti64)(unsafe.Pointer((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FaDoc + uintptr((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol)*8)) == 0) { break } - goto _3 - _3: + goto _5 + _5: ; (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiCol++ } @@ -224648,6 +228728,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse iVal++ pLe = *(*uintptr)(unsafe.Pointer(apVal + uintptr(v3)*8)) } + (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FcolUsed = idxNum & int32(FTS5_VOCAB_COLUSED_MASK) if pEq != 0 { zTerm = Xsqlite3_value_text(tls, pEq) nTerm = Xsqlite3_value_bytes(tls, pEq) @@ -224660,7 +228741,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse if pLe != 0 { zCopy = Xsqlite3_value_text(tls, pLe) if zCopy == uintptr(0) { - zCopy = __ccgo_ts + 1662 + zCopy = __ccgo_ts + 1663 } (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1)) @@ -224739,7 +228820,7 @@ func _fts5VocabColumnMethod(tls *libc.TLS, pCursor uintptr, pCtx uintptr, iCol i case int32(2): ii = -int32(1) if eDetail == FTS5_DETAIL_FULL { - ii = int32((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos >> libc.Int32FromInt32(32)) + ii = int32((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) } else { if eDetail == int32(FTS5_DETAIL_COLUMNS) { ii = int32((*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FiInstPos) @@ -224784,7 +228865,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+39608, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40211, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -224807,6 +228888,8 @@ func init() { *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_fts5VocabRowidMethod) } +/* Here ends the fts5.c composite file. */ + /************** End of fts5.c ************************************************/ /************** Begin file stmt.c ********************************************/ /* @@ -224837,7 +228920,7 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 39618 + return __ccgo_ts + 40221 } type TAggInfo_col = struct { @@ -224865,11 +228948,6 @@ type AggInfo_func = TAggInfo_func type TIdList_item = struct { FzName uintptr - Fu4 struct { - FpExpr [0]uintptr - Fidx int32 - F__ccgo_pad2 [4]byte - } } type IdList_item = TIdList_item @@ -224966,8 +229044,9 @@ type Tp4union = struct { Fai [0]uintptr FpProgram [0]uintptr FpTab [0]uintptr + FpSubrtnSig [0]uintptr Fi int32 - F__ccgo_pad14 [4]byte + F__ccgo_pad15 [4]byte } type p4union = Tp4union @@ -225119,11 +229198,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '6', '.', '1'} +var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '0'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-14.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=127\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfPos\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenRead\x00OpenWrite\x00BitNot\x00OpenDup\x00OpenAutoindex\x00String8\x00OpenEphemeral\x00SorterOpen\x00SequenceTest\x00OpenPseudo\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\x00Real\x00DropTrigger\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\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\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\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\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %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\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\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\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\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\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\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\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\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, %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, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\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', 0) 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\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\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)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\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\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\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 COLLATE nocase\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.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\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\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\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\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\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\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'\x00SELECT*FROM\"%w\".\"%w\"\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\x00FIRST\x00LAST\x00unsupported use of NULLS %s\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\x00 UNIQUE\x00CREATE%s INDEX %.*s\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\x00ON\x00USING\x00a JOIN clause is required before %s\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\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\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\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %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\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\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_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\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\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\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 join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\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\x00no such index: \"%s\"\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\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP 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\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow 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'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\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\x00syntax error\x00<expr>\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX %d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\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\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\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\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\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: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\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\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\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\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\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\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\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\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\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\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\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\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\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\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\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00<polyline points=\x00%c%g,%g\x00 %g,%g'\x00 %s\x00></polyline>\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\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;\x00AND rootpage!=0 AND rootpage IS NOT NULL\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\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), 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\x00may not have\x00requires\x00table %q %s rbu_rowid column\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 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\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\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\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_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\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\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\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\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\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\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\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\x00SELECT 0, 'tbl', '', 0, '', 1 UNION ALL SELECT 1, 'idx', '', 0, '', 2 UNION ALL SELECT 2, 'stat', '', 0, '', 0\x00PRAGMA '%q'.table_info('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\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\x00contentless_delete\x00malformed contentless_delete=... directive\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\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\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %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)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\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=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\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\x00flush\x00'delete' may not be used with a contentless_delete=1 table\x00DELETE from\x00cannot %s contentless fts5 table: %s\x00no such cursor: %lld\x00cannot UPDATE a subset of columns on fts5 contentless-delete table: %s\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\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(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00,?\x00,origin\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\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\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\x002024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-14.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\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\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\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\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\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\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %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\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\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\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\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\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\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, %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, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\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', 0) 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\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\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)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\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\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\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 COLLATE nocase\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.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\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\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\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\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\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\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'\x00SELECT*FROM\"%w\".\"%w\"\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\x00FIRST\x00LAST\x00unsupported use of NULLS %s\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\x00 UNIQUE\x00CREATE%s INDEX %.*s\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\x00ON\x00USING\x00a JOIN clause is required before %s\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\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\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\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %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\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\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_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\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\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\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 join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\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\x00no such index: \"%s\"\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\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP 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\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow 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'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\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\x00vacuum_%016llx\x00ATTACH %Q AS %s\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 %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.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\x00syntax error\x00<expr>\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\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\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\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\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\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: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\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\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\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\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\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\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\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\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\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\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\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\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\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\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\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00<polyline points=\x00%c%g,%g\x00 %g,%g'\x00 %s\x00></polyline>\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\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;\x00AND rootpage!=0 AND rootpage IS NOT NULL\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\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), 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\x00may not have\x00requires\x00table %q %s rbu_rowid column\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 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\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\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\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_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\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\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\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\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\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, %lld), (%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\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\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\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\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()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\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\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %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)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\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=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\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\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\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(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\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\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\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\x00trigram\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\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods |
